uitextview
How to set content inset for UITextView in ios
got answer: [atextView setTextContainerInset:UIEdgeInsetsMake(7, 7, 0, 0)]; fixed my problem. And in Swift… @IBOutlet var tv:UITextView! override func awakeFromNib() { super.awakeFromNib() tv.textContainerInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) } UPDATE: another option to do that. UIView *spacerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)]; [msgtext setLeftViewMode:UITextFieldViewModeAlways]; [msgtext setLeftView:spacerView];
How to make a UITableViewCell with a UITextView inside, that dynamically adjust its height, on the basis of the UITextView?
Looking at this,you need to be somewhat tricky. You need to calculate the height of the textView dynamically and based on the Height of the TextView,you need to return the Height for the cell.. It’s very easy & somewhat Tricky.. This is the code by which you can calculate the size of string…. First get … Read more
It is possible to show keyboard without using UITextField and UITextView iphone app?
For anyone, who wants to show keyboard without UITextField/UITextView for some reasons, could easily extend some view, which requires text input by implementing UIKeyInput protocol and canBecomeFirstResponder method.
How to set font weight as light, regular in Android
Use android:textStyle on a TextView to set the text style like bold, italic or normal. Here is an example of a TextView with a bold text style: <TextView android:id=”@+id/hello_world” android:text=”hello world” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:textStyle=”bold”/> If you want to use light or condensed, you will have to change your font. You can do it like this: … Read more
UITextView with Syntax Highlighting
UPDATE: Since iOS 7 and TextKit, syntax highlighting has become easy as pie. Look no further than here for an introduction (by me). Assuming that you want an editable component, there is not too much hope. Giving a quick overview, just to make sure I cover everything: UITextView: plain text only, no (public) way around. … Read more
Can’t make URL clickable in UITextView
Check the “Selectable” and “Links” checkboxes in the textview Attributes Inspector:
How to add image and text in UITextView in IOS?
This is absolutely possible now, using + (NSAttributedString *)attributedStringWithAttachment:(NSTextAttachment *)attachment See Apple docs here And this example taken from this other answer: UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,140,140)]; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@”before after”]; NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init]; textAttachment.image = [UIImage imageNamed:@”sample_image.jpg”]; CGFloat oldWidth = textAttachment.image.size.width; //I’m subtracting 10px to make the … Read more