UIButton文字对齐与手势长按执行两次的问题
2014-07-31 16:54
162 查看
UIButton文字对齐:
调用按钮中的titillabel来者是文字的对齐时无效的需要调用UIView中的方法,方法如下:
@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment; // how to position content vertically inside control. default is center
@property(nonatomic) UIControlContentHorizontalAlignment contentHorizontalAlignment; // how to position content hozontally inside control. default is center
手势长按执行两次问题:
手势在进行长按时会由几种状态,要对每种状态进行处理,根据需要咯,几种状态如下:
typedef NS_ENUM(NSInteger, UIGestureRecognizerState) {
UIGestureRecognizerStatePossible, // the recognizer has not yet recognized its gesture, but may be evaluating touch events. this is the default state
UIGestureRecognizerStateBegan, // the recognizer has received touches recognized as the gesture. the action method will be called at the next turn of the run loop
UIGestureRecognizerStateChanged, // the recognizer has received touches recognized as a change to the gesture. the action method will be called at the next turn of the run loop
UIGestureRecognizerStateEnded, // the recognizer has received touches recognized as the end of the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to UIGestureRecognizerStatePossible
UIGestureRecognizerStateCancelled, // the recognizer has received touches resulting in the cancellation of the gesture. the action method will be called at the next turn of the run loop. the recognizer will be reset to UIGestureRecognizerStatePossible
UIGestureRecognizerStateFailed, // the recognizer has received a touch sequence that can not be recognized as the gesture. the action method will not be called and the recognizer will be reset to UIGestureRecognizerStatePossible
// Discrete Gestures – gesture recognizers that recognize a discrete event but do not report changes (for example, a tap) do not transition through the Began and Changed states and can not fail or be cancelled
UIGestureRecognizerStateRecognized = UIGestureRecognizerStateEnded // the recognizer has received touches recognized as the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to UIGestureRecognizerStatePossible
};
对应UIGestureRecognizer中的state属性。
调用按钮中的titillabel来者是文字的对齐时无效的需要调用UIView中的方法,方法如下:
@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment; // how to position content vertically inside control. default is center
@property(nonatomic) UIControlContentHorizontalAlignment contentHorizontalAlignment; // how to position content hozontally inside control. default is center
手势长按执行两次问题:
手势在进行长按时会由几种状态,要对每种状态进行处理,根据需要咯,几种状态如下:
typedef NS_ENUM(NSInteger, UIGestureRecognizerState) {
UIGestureRecognizerStatePossible, // the recognizer has not yet recognized its gesture, but may be evaluating touch events. this is the default state
UIGestureRecognizerStateBegan, // the recognizer has received touches recognized as the gesture. the action method will be called at the next turn of the run loop
UIGestureRecognizerStateChanged, // the recognizer has received touches recognized as a change to the gesture. the action method will be called at the next turn of the run loop
UIGestureRecognizerStateEnded, // the recognizer has received touches recognized as the end of the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to UIGestureRecognizerStatePossible
UIGestureRecognizerStateCancelled, // the recognizer has received touches resulting in the cancellation of the gesture. the action method will be called at the next turn of the run loop. the recognizer will be reset to UIGestureRecognizerStatePossible
UIGestureRecognizerStateFailed, // the recognizer has received a touch sequence that can not be recognized as the gesture. the action method will not be called and the recognizer will be reset to UIGestureRecognizerStatePossible
// Discrete Gestures – gesture recognizers that recognize a discrete event but do not report changes (for example, a tap) do not transition through the Began and Changed states and can not fail or be cancelled
UIGestureRecognizerStateRecognized = UIGestureRecognizerStateEnded // the recognizer has received touches recognized as the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to UIGestureRecognizerStatePossible
};
对应UIGestureRecognizer中的state属性。
相关文章推荐
- 【控件】UIButton同时设图片和文字时的对齐问题
- TablView长按手势执行两次的问题
- iOS中关于设置UIButton文字和图标对齐格式的问题
- iOS中关于设置UIButton文字和图标对齐格式的问题
- 复选框单选框与文字对齐问题的研究与解决
- margin-bottom解决图片文字不对齐的问题
- 关于Spring中用quartz定时器在定时到达时同时执行两次的问题
- 关于Spring中用quartz定时器在定时到达时同时执行两次的问题
- struts2按钮被执行两次的灵异问题
- checkbox 文字与多选框的对齐问题
- 表单元素与提示文字无法对齐的问题(input,checkbox文字对齐)
- 关于Asp.net页面Page_Load被执行两次的问题
- iPhone开发--UIButton中文字对齐的问题
- 在mvc中,action执行两次的问题
- (转)表单元素与提示文字无法对齐的问题(input,checkbox文字对齐)
- 图片和文字对齐问题
- 关于default.aspx的page_load执行两次的问题
- Vs2003 转VS 2005 后 Page_Load 执行两次的问题
- 拷贝构造函数执行后析构函数调用两次出错问题
- 表单元素与提示文字无法对齐的问题(input,checkbox文字对齐)