zoukankan      html  css  js  c++  java
  • IOS内容属性总结

    四个容易混淆的属性

    1、textAlignment:文字的水平方向对齐方式

    1>取值

    NSTextAlignmentLeft

    NSTextAlignmentCenter

    NSTextAlignmentRight

    2>哪些控件有这个属性:一般能够显示文字的控件都有这个属性

    UITextField

    UILabel

    UITextView

    2.ContentVerticalAlignment:内容的垂直方向的对齐方式

    1>取值

    UIControlContentVerticalAlignmentCenter

    UIControlContentVerticalAlignmentTop

    UIControlContentVerticalAlignmentBottom

    2>哪些控件有这个属性:继承至UIControl的控件或者UIControl本身

    UIControl

    UIButton

    UITextField……

    3.contentHorizontalAlignment:内容的水平方向的对齐方式

    1>取值

    UIControlContentHorizontalAlignmentCenter

    UIControlContentHorizontalAlignmentLeft

    UIControlContentHorizontalAlignmentRight

    2>哪些控件有这个属性:继承至UIControl的控件或者UIControl本身

    UIControl

    UIButton

    UITextField……

    4.contentMode:内容模式(控制内容的对齐方式),一般对UIImageView很有用

    1>取值

    UIViewContentModeScaleToFill:拉伸图片至填充整个UIImageView

    UIViewContentModeScaleAspectFit:按照图片原来的宽高比进行拉伸,伸缩至适应整个UIImageView

    UIViewContentModeScaleAspectFill:按照图片原来的宽高比进行拉伸,伸缩至图片的宽度和UIImageView的宽度一样,或者图片的高度和UIImageView的高度一样

    UIViewContentModeRedraw:当控件的尺寸改变了,就重绘一次(重新调用setNeedDisplay,调用drawRect)

    UIViewContentModeCenter

    UIViewContentModeTop

    UIViewContentModeBottom

    UIViewContentModeLeft

    UIViewContentModeRight

    UIViewContentModeTopLeft

    UIViewContentModeTopRight

    UIViewContentModeBottomLeft

    UIViewContentModeBottomRight

    2>哪些控件有这个属性:所有UI控件都有

  • 相关阅读:
    初探XML
    Hibernate 由实体类与配置文件的配置关系生成数据库中的表
    利用JSP中的过滤器解决中文乱码问题
    关于iBatis配置xml文件时出现中文注释出错的一个问题(很坑爹.)
    Myeclipse中xml文件里自动提示消失解决办法
    iBatis的基本配置+CRUD操作
    Myeclipse下配置svn
    Hibernate与iBastis 比较(转载)
    本人了解的分页查询
    Hibernate五大核心接口简介
  • 原文地址:https://www.cnblogs.com/luseike/p/3925859.html
Copyright © 2011-2022 走看看