Domanda

I'm using xib with single UITextView inside, to display pre formatted text page. It's too complex to format the text in code, so I do the formatting in Apple Pages and then paste formatted text in xib's UITextView object. I load this xib in page like this

subviewArray = [[NSBundle mainBundle]
loadNibNamed:[language stringByAppendingString:_textXibName]
       owner:self options:nil];
textView = [subviewArray objectAtIndex:0];
textView.delegate=self;
textView.editable=NO;
textView.frame = CGRectMake(_textOrigin.x , _textOrigin.y , textView.frame.size.width, textView.frame.size.height);
[self.vignetteView addSubview:textView];

image xcode xib http://jonathan-thebook.com/x1_xcode.png
In IOS 6.1 everything looks perfect.
screen shot in iOS 6.1, looking OK http://jonathan-thebook.com/x1_right_6.1.png
But in 5.1 and below all formating in suddenlty lost!
screen shot in iOS 5.1, formatting is lost http://jonathan-thebook.com/x1_wrong_5.1.png
Where to start digging? Maybe because I'm in a mild state of panic I have no idea! Any advice is highly appreciated!

È stato utile?

Soluzione

UITextView and UITextField support for styled text using attributed strings was added in iOS 6. Your best option in iOS 5 is to use HTML and a UIWebView

See: https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS6.html#

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top