我看到了这个(注意第一行的填充):
我要这个:
相关代码:
-(voID)setupQuestionVIEw{ [self.questionVIEw setAttributedText:[self.allContents[_itemIndex] objectForKey:@"Question"]]; // new question vIEw height CGSize constraint = CGSizeMake(kCellWIDth - kleftmargin - kRightmargin,FLT_MAX); CGSize size = [self.questionVIEw.text sizeWithFont:[UIFont systemFontOfSize: kFontSize] constrainedToSize:constraint lineBreakMode:NSlineBreakByWorDWrapPing]; [self.questionVIEw setFrame:CGRectMake(kRightmargin,ktopmargin,kCellWIDth - kRightmargin * 2,size.height)]; [self.questionVIEw.layer setborderWIDth:1.0f]; // deBUG}解决方法 kleftmargin和kRightmargin是否相等?我找不到其他地方可能出错的地方. 总结
以上是内存溢出为你收集整理的iOS归因于字符串高度全部内容,希望文章能够帮你解决iOS归因于字符串高度所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)