1> 使用场合*UIImageView:仅仅显示图片*UIButton:显示图片,同时监听图片点击2>相同点:都能显示图片3>不同点*UIButton能处理点击事件,UIImageView不成处理点击事件(默认)*UIButton既能显示图片,又能显示文字*UIButton能同时显示两张图片*UIB...
分类:
其他好文 时间:
2015-06-27 16:15:32
阅读次数:
59
UIButton 有的时候需要用代码做样式调整 其中就包括添加阴影
如下图 中登陆 按钮
此时需要考虑对button的layer进行设置
代码如下:
loginBtn=[UIButton buttonWithType:UIButtonTypeCustom];
loginBtn.frame=CGRectMake(10, 120, 88, 36);
...
分类:
其他好文 时间:
2015-06-27 09:47:19
阅读次数:
452
int i;-(UIButton *)praiseBtn{ if (!_praiseBtn) { _praiseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_praiseBtn setBac...
分类:
其他好文 时间:
2015-06-26 19:25:28
阅读次数:
184
UI 控件懒加载问题:1, 什么时候使用懒加载加载UI控件?2, 加载控件的什么属性?3, 用什么类型的指针修饰控件?code : (ARC)定义属性,@property(nonatomic,weak) UIButton *customBtn1;重写getter方法-(UIButton *)cust...
分类:
其他好文 时间:
2015-06-26 17:49:55
阅读次数:
150
通过layler//创建头像视图UIButton*logoButton=[[UIButtonalloc]init];logoButton.frame=CGRectMake(50,50,100,100);logoButton.layer.cornerRadius=50;logoButton.backg...
分类:
其他好文 时间:
2015-06-26 10:50:32
阅读次数:
111
自动布局#import "ViewController.h"#import @interface ViewController ()@property (weak, nonatomic) IBOutlet UIButton *buttonImg;@end@implementation ViewCon...
分类:
其他好文 时间:
2015-06-25 17:12:34
阅读次数:
146
先上代码
//登录按钮
loginBtn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
loginBtn.frame=CGRectMake(1, 199, 200, 36);
[self.view addSubview:loginBtn];
[loginBtn addTarget:self...
分类:
其他好文 时间:
2015-06-24 19:12:30
阅读次数:
124
转:http://www.cnblogs.com/huichun/p/3419596.htmluiButton控件上自带了一个uiLabel类型的子控件和一个uiImageView类型的子控件,如果可以正确使用他们的edgeInsets属性,就能把button设置成我们想要的样子。 关于titl....
分类:
其他好文 时间:
2015-06-24 18:21:52
阅读次数:
158
自定义GXCustomButton类继承自UIButton类.m中的代码如下:#import "GXCustomButton.h"#defineKSImageScale0.6@implementation GXCustomButton#pragma mark 设置Button内部的image的范围-...
分类:
其他好文 时间:
2015-06-24 16:07:29
阅读次数:
92
UIButton *selectMore = [UIButton buttonWithType:UIButtonTypeCustom]; selectMore.frame = CGRectMake(0, __kScreenHeight - 42, __kScreenWidth / 2, 42); /...
分类:
其他好文 时间:
2015-06-24 12:33:18
阅读次数:
102