UIButton和UILabel的宽与高
来源:互联网 发布:男士护肤推荐 知乎 编辑:程序博客网 时间:2024/06/06 01:30
UIButton:
1、UIButton对于自定义Button需要设置宽度和高度才能显示,
2、而系统的Button在系统内部设置了宽度高度所以不需要认再去设置,如果人为改变其大小,显示的imageView大小是没有变化,只是Button的大小发生了改变
3、代码如下:
UIButton*button = [UIButtonbuttonWithType:UIButtonTypeContactAdd];
button.frame = CGRectMake(100, 100, 100, 100);
button.backgroundColor = [UIColorredColor];
[self.viewaddSubview:button];
NSLog(@"%@",NSStringFromCGRect(button.frame));
UILabel:
1、UILabel需要设置宽度和高度才能显示
UILabel *lalel = [[UILabelalloc] initWithFrame:CGRectMake(100,100, 100, 100)];
lalel.backgroundColor = [UIColorredColor];
[self.viewaddSubview:lalel];
NSLog(@"%@",NSStringFromCGRect(lalel.frame));
0 0
- UIButton和UILabel的宽与高
- UILabel和UIButton的属性
- UILabel 和UIButton的简单实用
- UIButton和UILabel的常见设置方法
- 【UILabel和UIButton】
- Swift UIButton 和 UILabel 的详细解释和创建使用
- UIButton和UILabel添加下划线
- UILabel和UIButton添加下划线
- iOS学习笔记------UIButton、UIImageView、UILabel的属性与方法
- Swift UIButton、UILabel、UITextField的创建与用法
- iOS中UILabel和UIButton的自定义设置
- UIButton和的UILabel添加下划线,中划线
- iOS10 UILabel和UIButton显示不全的解决方案
- iOS 使用storyboard设置UIButton 和UILabel 的圆角
- UILabel宽高的计算
- UILabel、UIButton
- UIButton&UILabel
- UILabel UIButton
- BCE0004: Ambiguous reference 'preview': CameraMotionBlurEditor.preview, UnityEditor.Editor.preview.
- 成员变量、类变量、局部变量的区别
- 原生下拉刷新SwipeRefreshLayout的使用
- win7 安装ubuntu14.04 双系统 加hisi3531 交叉编译移植
- 剑指offer-3-面试14:调整数组顺序使奇数位于偶数前面
- UIButton和UILabel的宽与高
- 计算给定时间与现在的时间差
- MyEclipse 快捷键
- 使用import简化Spring配置文件
- SpringMVC——Controller和视图之间数据的相互传递
- Android 的状态模式
- lua的metatable查找成员源码分析
- linux sed命令详解
- 如何让页面撑满整个浏览器屏幕