码迷,mamicode.com
首页 > 其他好文 > 详细

0011-UI

时间:2016-01-19 01:37:32      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

1.NSTimer的一个类方法?

答:功能:监听对象,计时执行方法.

+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(nullable id)userInfo repeats:(BOOL)yesOrNo;

2.OC的一个别名?

答:double类型的别名.

typedef double NSTimeInterval;

3.NSTimer的一个方法?

答:功能:停止闹钟的唯一方法.

- (void)invalidate;

4.NSTimer准确吗?

答:不准确,通常是用来有一定事件跨度的周期性事件的处理.

5.UIAlertView的一个方法?

答:功能:结合show可以弹出一个提示框.

- (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message delegate:(nullable id /*<UIAlertViewDelegate>*/)delegate cancelButtonTitle:(nullable NSString *)cancelButtonTitle otherButtonTitles:(nullable NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION NS_EXTENSION_UNAVAILABLE_IOS("Use UIAlertController instead.");

- (void)show;

6.NSTimer的一个方法?

答:功能:配合下面一个方法,达到计时器效果,forMode:有两个可选参数,一个是默认,一个运行循环.

FOUNDATION_EXPORT NSString * const NSDefaultRunLoopMode;

FOUNDATION_EXPORT NSString * const NSRunLoopCommonModes NS_AVAILABLE(10_5, 2_0);

+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(nullable id)userInfo repeats:(BOOL)yesOrNo;

[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];

7.代理的作用是什么?

答:监听哪些addTarget不能监听的事件.

8.UIButton,UILabel,UIImageView,UITextField的继承关系?

答:一.UIButton -> UIControl ->UIView

    二.UILabel   -> UIView

    三.UIImageView ->UIView

    四.UITextField ->UIView

9.为什么addTarget能执行@selecor的方法?

答:将监听方法,注册到"运行循环",当按钮被点击后,"运行循环"通知试图控制器执行@selector的方法.

10.UIControl里面最重要的属性?

答:

启用,禁用
@property(nonatomic,getter=isEnabled) BOOL enabled;   
选中,不选中  
@property(nonatomic,getter=isSelected) BOOL selected; 
高亮,不高亮
@property(nonatomic,getter=isHighlighted) BOOL highlighted;   
设置控件内容的布局
垂直居中方向
@property(nonatomic) UIControlContentVerticalAlignment 
contentVerticalAlignment; 
水平居中方向
@property(nonatomic) UIControlContentHorizontalAlignment contentHorizontalAlignment;

 

0011-UI

标签:

原文地址:http://www.cnblogs.com/paintingeggs/p/5140917.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!