Question

In my UITextView, I remove all padding and set the text to align to the right. On iOS 7, this works without a hitch. However, on iOS 6, the padding is still present on the right for an unknown reason. And when the text is just a certain size, it doesn't wrap properly because the height is calculated to fit on one line, but it is being displayed on two lines. Compare these screenshots (and to note, this occurs on both device and simulator):

iOS 6 iOS 7

I'm also setting zero margins on each of my text views using a 'utility' function as seen below:

+ (void) setZeroInsetsForTextView:(UITextView *) textView {
    if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
        // iOS 6
        textView.contentInset = UIEdgeInsetsMake(-11.0, -8.0, -11.0, -8.0); // top, left, bottom, right
    } else {
        // iOS 7
        textView.textContainer.lineFragmentPadding = 0.0;
        textView.textContainerInset = UIEdgeInsetsZero;
    }
}

Any ideas? I'm not quite sure what I need to do to address this or if I just forget iOS 6 people, as they are an ever-shrinking market.

Thank you. :)

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top