当前位置: 首页 > news >正文

徐州人才网官方网站网站设计规划报告

徐州人才网官方网站,网站设计规划报告,村建站全称,做网站怎么做有时一个UILable的text内容是变化的#xff0c;而且差异有很大#xff0c; 需求上要求UILabel的大小高宽能够自适应text的内容。代码例子#xff1a; myLable[[UILabel alloc] initWithFrame:CGRectMake(0, 23, 175, 33)]; [myLable setFont:[UIFont fontWithName:而且差异有很大   需求上要求UILabel的大小高宽能够自适应text的内容。代码例子   myLable[[UILabel alloc] initWithFrame:CGRectMake(0, 23, 175, 33)];   [myLable setFont:[UIFont fontWithName:Helvetica size:10.0]];   [myLable setNumberOfLines:0];   [myLable setBackgroundColor:[UIColor clearColor]];   [myAdView addSubview:myLable];   UIFont *font  [UIFont fontWithName:Helvetica size:10.0];   CGSize size  [text sizeWithFont:font constrainedToSize:CGSizeMake(175.0f, 2000.0f)                                             lineBreakMode:UILineBreakModeWordWrap];   CGRect rectmyLable.frame;   rect.sizesize;   [myLable setFrame:rect];   [myLable setText:text];    核心的是  CGSize size  [text sizeWithFont:font constrainedToSize:CGSizeMake(175.0f, 2000.0f)                       lineBreakMode:UILineBreakModeWordWrap];  来预算text显示时宽高。  其中font是显示的字体constrainedToSize是最大可接受的字符串宽高(例子中是宽175高2000)  lineBreakMode换行类型(UILineBreakModeWordWrap指的单词边界换行)    sizeWithFont:constrainedToSize:lineBreakMode: Returns the size of the string if it were rendered with the specified constraints. - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)lineBreakMode Parameters font The font to use for computing the string size. size The maximum acceptable size for the string. This value is used to calculate where line breaks and wrapping would occur. lineBreakMode The line break options for computing the size of the string. For a list of possible values, see NSLineBreakMode. Return Value The width and height of the resulting string’s bounding box. These values may be rounded up to the nearest whole number. Discussion You can use this method to obtain the layout metrics you need to draw a string in your user interface. This method does not actually draw the string or alter the receiver’s text in any way. This method computes the metrics needed to draw the specified string. This method lays out the receiver’s text and attempts to make it fit the specified size using the specified font and line break options. During layout, the method may break the text onto multiple lines to make it fit better. If the receiver’s text does not completely fit in the specified size, it lays out as much of the text as possible and truncates it (for layout purposes only) according to the specified line break mode. It then returns the size of the resulting truncated string. If the height specified in the size parameter is less than a single line of text, this method may return a height value that is bigger than the one specified. Availability Available in iOS 2.0 and later. Declared In UIStringDrawing.h转载于:https://www.cnblogs.com/mohe/p/3586568.html
http://www.huolong8.cn/news/84829/

相关文章:

  • 做网站用c 还是js网站搭建费用价格表
  • 沈阳网站seo公司中国软件公司排行
  • 文件包上传的网站怎么做静态网站开发实训的目的
  • vs开发网站开发教程重庆网站推广产品企业
  • 上海品划做网站wordpress侧边小图标联系方式
  • 瓯海网站建设陕西机械加工网
  • 做asp.net网站参考文献wordpress好还是hexo好
  • 普洱建设网站建立门派
  • 娱乐网站制作东莞网站建设模具
  • 个人网站设计报告书网站页面怎么算
  • 建设网站方法wordpress是公益
  • 刘晓忠 网站建设08影院源码WordPress
  • 建网站用什么服务器好无锡专业网站制作的公司
  • 建站公司兴田德润小说百度搜索风云榜
  • 网站怎么自适应遂宁网站优化
  • 潍坊网站建设招商西安宝马建设科技股份有限公司网站
  • 企业网站建设方案有那些网站模版 下载工具
  • 谷歌排名优化济南seo优化外包服务
  • 赣州网站建设百家号wordpress主题 导出
  • net网站开发找那家玉溪市规划建设局网站
  • 如何建设废品网站网站推广优化方法
  • html网站源代码芜湖企业网站制作
  • 萧山中兴建设有限公司网站电子项目外包网站
  • 网站建设网站优化大师电脑版官方免费下载
  • 如何转移网站亚马逊雨林属于哪个国家的
  • 福州模板建站代理关于seo关键词选择有哪些方法
  • 网站建设进什么分录验证码平台网站开发
  • 宿迁网站定制百度人工电话多少号
  • 泾川网站城镇建设规化图wordpress怎样搭建
  • 哪家网站建设公司好免费手机端网站模板下载工具