簡體   English   中英

UITextView不滾動

[英]UITextView not scrolling

無論文本大小如何,我都需要帶文本的UITextView滾動。 我似乎無法弄清楚為什么UITextView隨文本大小滾動。 我給了它異常高的高度和所有東西。 有人可以幫我嗎?

 - (void)viewDidLoad
{
    [super viewDidLoad];

    self.navigationController.navigationBar.topItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];

    self.title = @"About";


    self.scrollView = [[UITextView alloc]init];

    NSLog(@"%@",self.scrollView);
    //self.aboutLabel.text = [DBConnector returnAboutDescription];

  //  self.aboutLabel.numberOfLines = 0;


    self.scrollView.scrollEnabled = YES;

    //[self.scrollView setContentSize:CGSizeMake(320, 1000)];
    self.scrollView.text = [DBConnector returnAboutDescription];

    self.scrollView.editable = NO;


  [self.scrollView scrollRangeToVisible:NSMakeRange(self.scrollView.text.length - 1, 0)];


    }

謝謝!

嘗試將UILabel添加為子視圖。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM