如何在 UITextView 下添加 UIImageViews(UITextView 跨越整個屏幕) (How do you add a UIImageViews under a UITextView (the UITextView spans entire screen))


問題描述

如何在 UITextView 下添加 UIImageViews(UITextView 跨越整個屏幕) (How do you add a UIImageViews under a UITextView (the UITextView spans entire screen))

My UITextView has a description, but at the bottom of it, I want to add images underneath the last line of text. How do I do that? 

UITextView* description = [[UITextView alloc] init];
description.frame = CGRectMake(0, 0, 320, 420);
description.text = [self.dict valueForKey:@"description"];
description.font = [UIFont systemFontOfSize:14];
[self.view addSubview:description];

EDITED: The text is not editable. What I really want to do looks like an app in the Apple App Store. After scrolling to the bottom of the description, there's a scrollable view of screenshots. I want to implement the same thing as that.

Thanks!


參考解法

方法 1:

Not sure I understand exactly what you're asking for, but look into UIScrollView and UITableView (a subclass of UIScrollView). A tableview might work best as you can add your textview to one cell, and then the image views in subsequent cells. If you can post additional details, I might be able to help more. 

(by user1467188Matt S.)

參考文件

  1. How do you add a UIImageViews under a UITextView (the UITextView spans entire screen) (CC BY-SA 3.0/4.0)

#uitextview #iOS #XCode #uiview






相關問題

textViewDidBeginEditing 由於縮放而未觸發 (textViewDidBeginEditing not firing due to zoom)

如何在 UITextView 下添加 UIImageViews(UITextView 跨越整個屏幕) (How do you add a UIImageViews under a UITextView (the UITextView spans entire screen))

UITextView tidak mengaktifkan textViewDidChange pada perubahan atribut? (UITextView not firing textViewDidChange on attribute change?)

向 UITextView 的框架添加陰影 也向文本添加陰影 (Add shadow to frame of UITextView add also shadow to text)

uitextview 字體不隨 fontWIthName 改變 (uitextview font not changing with fontWIthName)

帶有自己的 UIToolbar 的 UITextView 和 UIPickerView (UITextView and UIPickerView with its own UIToolbar)

為什麼 UITextView 的 text 屬性使用字符串而不是可變字符串? (Why does UITextView use string rather than mutable string for its text property?)

UILabel 中的多行文本 (Multiple lines of text in UILabel)

如何在 iPhone 的 UITextView 中嵌入鏈接 (How to embed a link in a UITextView for the iphone)

UITextView - 修改選定的文本 (UITextView - modifying selected text)

如何以編程方式將鍵盤視圖從“符號”重置為“字母” (How to reset keyboard view from 'symbols' to 'alphabet' programmatically)

UITextView 不會更改 textColor 屬性 (UITextView does not change textColor property)







留言討論