zoukankan      html  css  js  c++  java
  • UITextView只能显示两行问题

       需求:UITextView只能显示两行

        UITextView * textView = [[UITextView alloc]init];

        textView.frame = CGRectMake(20, 30, [UIScreen mainScreen].bounds.size.width-40, [UIScreen mainScreen].bounds.size.height-30);

        textView.font= [UIFont systemFontOfSize:15];    

        textView.delegate =  self;

        [self.view addSubview:view];

       网络资料显示方法:view.textContainer.maximumNumberOfLines = 2;但是这个方法显示两行但是获取到的字符串不止两行,所有要严格获取两行文本文字,此方法没有效果,只能通过判断textView.text.length来限制输入的内容。

    by:lm

  • 相关阅读:
    json
    ajax
    oracle 分页查询
    NuGet使用
    【EF】Entity Framework使用
    【mssql】增删改查笔记
    【mysql】知识点
    【angularJS】学习笔记
    C# Ninject使用
    【CSS】Table样式
  • 原文地址:https://www.cnblogs.com/widgetbox/p/9726041.html
Copyright © 2011-2022 走看看