I’ve created a UITextView programmatically with the follow:
messageBodyTxt = [[UITextView alloc] initWithFrame:CGRectMake(36, 204, 763, 251)];
[messageBodyTxt setTextColor:[UIColor colorWithRed:0.627 green:0.627 blue:0.627 alpha:1]];
[messageBodyTxt setBackgroundColor:[UIColor clearColor]];
[messageBodyTxt setText:@"some random text"];
However, the setText property is not showing my text. My header file looks like this:
#import <UIKit/UIKit.h>
@interface MessageView : UIView {
UITextView *messageBodyTxt;
}
@end
and i’ve added it to my view like so:
[self addSubview:messageBodyTxt];
All of my other UILabel‘s function properly when I use the setText method, however I can’t seem to get the UITextView to show anything.
Any ideas?
I figured it out. The frame of the parent view was too small, and not being clipped, so I could see all of my other elements in the view showing up, but they were not clickable (eg. buttons and such)
As soon as I fixed the parent view frame to be the correct size, the `UITextView text magically showed up.
Thanks everyone you’d done great!