zoukankan      html  css  js  c++  java
  • 关于titleEdgeInsets的使用

    对于上下移动而言,取决于top和down的值,移动的距离为|top - down|/2,就是top减去down差的绝对值的一半,具体方向需要看这两个参数。左右的原理与上下一致。
    A positive value shrinks, or insets, that edge—moving it closer to the center of the button. A negative value expands, or outsets, that edge,这句话是文档里的,意思就是如果参数值为正,那么相应方向将会向button的中心靠,负值,将会向外偏移。

    现在只列举top与down来解释说明,分4种情况(参与运算的各参数一定要带符号)
    1)top为正,down为正,移动的方向取决于值大的参数;如果top大于down,那么文字将向下移动,移动的距离为|top - down|/2,反之
    2)top为正,down为负,移动的方向为向下;移动的距离为|top - down|/2
    3)top为负,down为正,移动的方向为向上;移动的距离为|top - down|/2
    4)top为负,down为负,移动的方向取决于绝对值大的参数;如果|top|大于|down|,那么文字将向上移动,移动的距离为|top - down|/2,反之

    贴出文档中的描述
    Discussion
    Use this property to resize and reposition the effective drawing rectangle for the button title. You can specify a different value for each of the four insets (top, left, bottom, right). A positive value shrinks, or insets, that edge—moving it closer to the center of the button. A negative value expands, or outsets, that edge. Use the UIEdgeInsetsMake function to construct a value for this property. The default value is UIEdgeInsetsZero.

    The insets you specify are applied to the title rectangle after that rectangle has been sized to fit the button’s text. Thus, positive inset values may actually clip the title text.

    This property is used only for positioning the title during layout. The button does not use this property to determine intrinsicContentSize and sizeThatFits.

  • 相关阅读:
    CentOS 6.3用ssh无密码登陆其它主机
    堆排序算法以及JAVA实现
    TaskTracker发送Heartbeat以及接受HeartbeatResponse
    Linux常用命令总结
    用eclipse将mapreduce程序打成jar包并在命令行执行
    jquery自定义验证方法
    solaris中几个网络经典命令小结
    DWR的简单总结[转]
    java 编码问题 及转换
    DWR学习详解【转】
  • 原文地址:https://www.cnblogs.com/iOS-kk/p/5207272.html
Copyright © 2011-2022 走看看