import UIKitclass ViewController: UIViewController { @IBOutlet var button : UIButton? //var alertView:UIAlertView? override func viewDidL...
分类:
编程语言 时间:
2015-06-24 07:04:27
阅读次数:
184
?通过修改控件的frame属性就可以修改控件在屏幕上的位置和尺寸?比如点击“向上”按钮,让按钮的y值减小即可- (IBAction)top:(UIButton *)sender { CGRect btnFrame = self.headBtn.frame; btnFrame.origin.y -= ...
分类:
其他好文 时间:
2015-06-23 13:22:32
阅读次数:
100
以下代码中有Xcode中常见的3种注释/**
* 阴影 注释(1)这种注释在饮用cover时会出现在解释中
*/
@property (weak,nonatomic) IBOutlet UIButton *cover;
/**
* 控制状态栏的样式
* 注释(2)
* @return UIStatusBarStyleLightContent
*/
5. (UIStatusB...
分类:
其他好文 时间:
2015-06-22 06:29:48
阅读次数:
134
最近在使用selector时经常思考的问题,
给UIButton 添加点击事件,可以在selector后加“:”将button作为参数传入方法中,
今天用
[NSTimer
scheduledTimerWithTimeInterval:1
target:self
selector:@selector(rotateAction:)
userInfo:nil
repeats:NO];
...
分类:
移动开发 时间:
2015-06-21 18:38:07
阅读次数:
145
创建: UIButton?*hongbao?=?[UIButton?buttonWithType:UIButtonTypeCustom]; Custom:自定义按钮 System:对图片貌似有影响,显示的不是正常的图片 调整位置:这俩函数调了半天:注意偏移是指原有的位置,并不...
分类:
移动开发 时间:
2015-06-20 15:49:51
阅读次数:
193
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; // sysytem 自带渲染效果,就是有种按下去的感觉
UIImage *image = [UIImage imageNamed:@"5ZPU059BYTUY)CE9ZIKWEPN.jpg"];
[button setImage:image ...
分类:
移动开发 时间:
2015-06-20 11:54:52
阅读次数:
1696
写一个小问题,如何将navigationBar上的左边按钮移除,实现起来有两种方式,这两种方式都可以达到要求
UIButton *button = [UIButton
buttonWithType:UIButtonTypeContactAdd];
button.frame =
CGRectMake(0,
0, 30,
30);
UIB...
分类:
其他好文 时间:
2015-06-19 18:44:45
阅读次数:
169
在ios 8 下面leftBarButtonItems的位置失败 //左上角LOGO UIButton *button = [UIButtonbuttonWithType:UIButtonTypeCustom]; [button setImage:[UIImageimageNamed:@"home_...
分类:
其他好文 时间:
2015-06-19 13:25:00
阅读次数:
157
后面经过测试,如果button的文字长度变更,会导致图片位置变化,经过多次修改UIEdgeInsets的值也没有达到期望效果,最终采用集成UIButton类,重写layoutSubviews函数实现,特将成果记录一下,以便后续查阅123456789101112131415161718-(void)l...
分类:
移动开发 时间:
2015-06-18 17:04:51
阅读次数:
177
1)创建UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 风格有如下typedef enum { UIButtonTypeCustom = 0, // 自定义,无风格 UIButtonTypeRoun...
分类:
其他好文 时间:
2015-06-18 16:40:39
阅读次数:
119