Remove UITextView extra border

前端 未结 2 420
礼貌的吻别
礼貌的吻别 2021-01-23 09:52

I\'ve made a UITextView yet there\'s some unwanted spacing:

\"black

(I\'m drawing the

相关标签:
2条回答
  • 2021-01-23 10:05

    It seems that the following does the trick:

    UITextView *textView = ...;
    [textView setContentInset:UIEdgeInsetsMake(-10, -8, 0, 0)];
    

    The result is exactly as I wanted it to be. This isn't too satisfying as it uses magic numbers, so if anyone has a better answer, feel free to comment or answer.

    0 讨论(0)
  • 2021-01-23 10:17

    Have you tried experimenting with textContainerInset?

    According to the docs at developer.apple.com, "This property provides text margins for text laid out in the text view." This is new in iOS 7.

    0 讨论(0)
提交回复
热议问题