gpt4 book ai didi

ios - UITextView 在中间切开

转载 作者:行者123 更新时间:2023-11-29 02:42:14 25 4
gpt4 key购买 nike

我的 UITextView 遇到问题。在模拟器上,它通常向我显示 UITextView ,没有任何剪切,但是当我在真实设备上运行该项目时,我在中间得到了剪切。

self.popisakce.text = [self.objc objectForKey:@"Class"];
[self.popisakce sizeToFit]; //added
[self.popisakce layoutIfNeeded]; //added
[self.popisakce sizeToFit];
CGRect frame = self.popisakce.frame;
CALayer *imageLayerRRR = self.popisakce.layer;
[imageLayerRRR setCornerRadius:5];
[imageLayerRRR setMasksToBounds:YES];

UIScrollView* scrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0,25,768, 900)];
scrollview.showsVerticalScrollIndicator=YES;
scrollview.scrollEnabled=YES;
scrollview.userInteractionEnabled=YES;
[self.view addSubview:scrollview];
scrollview.contentSize = CGSizeMake(768,frame.size.height+770);

下面是我的输出:

link

最佳答案

当您将文本放在不可见的 UITextView 中时,它可能无法完全显示。

尝试将行 self.popisakce.text = [self.objc objectForKey:@"Class"]; 移到代码流的下方。

关于ios - UITextView 在中间切开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25618834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com