`
zani
  • 浏览: 356651 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

偏移UIButton中的titleLabel的x,y

 
阅读更多

// move text 10 pixels down and right
[button setTitleEdgeInsets:UIEdgeInsetsMake(10.0, 10.0, 0.0, 0.0)]
 
分享到:
评论

相关推荐

    uibutton的使用

    button.frame = CGRect(x: 0, y: 0, width: 100, height: 50) button.setTitle("点击我", for: .normal) view.addSubview(button) ``` 在这里,我们创建了一个系统类型的按钮,设置了它的大小、位置以及默认状态下...

    iOS如何将UIButton中的图片与文字上下对齐详解

    let button = UIButton(frame: CGRect(x: 100, y: 200, width: 100, height: 100)) button.setImage(UIImage(named: "button.png"), for: .normal) button.setTitle("按钮", for: .normal) button....

    详解iOS中UIButton的三大UIEdgeInsets属性用法

    button.frame = CGRect(x: 50, y: 200, width: 200, height: 50) button.setTitle("我是UIButton", for: .normal) button.setTitleColor(.blue, for: .normal) button.backgroundColor = .orange button.titleLabel?...

    iOS实现知乎和途家导航栏渐变的文字动画效果

    同时,为了实现下拉放大图片的效果,可以在`scrollViewDidScroll:`中根据滚动偏移量动态调整图片的大小。 ```swift func scrollViewDidScroll(_ scrollView: UIScrollView) { // ...更新导航栏高度 let scale = ...

    ios开发记录

    //一般使用bounds不设置x和y只设置宽和高 //center是相对于其父视图而言的,是CGpoint类型 _vi.bounds=CGRectMake(0, 0, 200, 200); // vi.center=CGPointMake(160, 240); _vi.center=_window.center; //arc4...

Global site tag (gtag.js) - Google Analytics