获取iOS控件的隐藏属性
来源:互联网 发布:幼儿识字软件下载 编辑:程序博客网 时间:2024/05/21 10:03
我们在开发的过程中用到的一些控件,明明一些属性我们一定会用到,但是是查看API就是没有,这个时候一般人会吐槽一下苹果;随后就是选择自己封装或者使用其他的实现方式来实现 。但是好多时候从网上搜出来的时候,人家大多都是通过KVC实现,这时候我就想人家咋获得的这些属性,我们怎么就不知道呢!其实很简单的……
1、首先引入头文件:#import <objc/runtime.h>
unsigned int count = 0;
Ivar *ivars = class_copyIvarList([UITextField class], &count);
for (int i = 0; i<count; i++) {
Ivar ivar = ivars[i];
NSLog(@"UITextField--->%s------%s", ivar_getName(ivar),ivar_getTypeEncoding(ivar));
}
UITextField--->_textStorage------@"_UICascadingTextStorage"
UITextField--->_borderStyle------q
UITextField--->_minimumFontSize------d
UITextField--->_delegate------@
UITextField--->_background------@"UIImage"
UITextField--->_disabledBackground------@"UIImage"
UITextField--->_clearButtonMode------q
UITextField--->_leftView------@"UIView"
UITextField--->_leftViewMode------q
UITextField--->_rightView------@"UIView"
UITextField--->_rightViewMode------q
UITextField--->_traits------@"UITextInputTraits"
UITextField--->_nonAtomTraits------@"UITextInputTraits"
UITextField--->_fullFontSize------d
UITextField--->_padding------{UIEdgeInsets="top"d"left"d"bottom"d"right"d}
UITextField--->_selectionRangeWhenNotEditing------{_NSRange="location"Q"length"Q}
UITextField--->_scrollXOffset------i
UITextField--->_scrollYOffset------i
UITextField--->_progress------f
UITextField--->_clearButton------@"UIButton"
UITextField--->_clearButtonOffset------{CGSize="width"d"height"d}
UITextField--->_leftViewOffset------{CGSize="width"d"height"d}
UITextField--->_rightViewOffset------{CGSize="width"d"height"d}
UITextField--->_backgroundView------@"UITextFieldBorderView"
UITextField--->_disabledBackgroundView------@"UITextFieldBorderView"
UITextField--->_systemBackgroundView------@"UITextFieldBackgroundView"
UITextField--->_floatingContentView------@"_UIFloatingContentView"
UITextField--->_contentBackdropView------@"UIVisualEffectView"
UITextField--->_fieldEditorBackgroundView------@"_UIDetachedFieldEditorBackgroundView"
UITextField--->_fieldEditorEffectView------@"UIVisualEffectView"
UITextField--->_displayLabel------@"UITextFieldLabel"
UITextField--->_placeholderLabel------@"UITextFieldLabel"
UITextField--->_suffixLabel------@"UITextFieldLabel"
UITextField--->_prefixLabel------@"UITextFieldLabel"
UITextField--->_iconView------@"UIImageView"
UITextField--->_label------@"UILabel"
UITextField--->_labelOffset------d
UITextField--->_interactionAssistant------@"UITextInteractionAssistant"
UITextField--->_selectGestureRecognizer------@"UITapGestureRecognizer"
UITextField--->_inputView------@"UIView"
UITextField--->_inputAccessoryView------@"UIView"
UITextField--->_systemInputViewController------@"UISystemInputViewController"
UITextField--->_atomBackgroundView------@"UITextFieldAtomBackgroundView"
UITextField--->_textFieldFlags------{?="verticallyCenterText"b1"isAnimating"b4"inactiveHasDimAppearance"b1"becomesFirstResponderOnClearButtonTap"b1"clearsPlaceholderOnBeginEditing"b1"adjustsFontSizeToFitWidth"b1"fieldEditorAttached"b1"canBecomeFirstResponder"b1"shouldSuppressShouldBeginEditing"b1"inResignFirstResponder"b1"undoDisabled"b1"explicitAlignment"b1"implementsCustomDrawing"b1"needsClearing"b1"suppressContentChangedNotification"b1"allowsEditingTextAttributes"b1"usesAttributedText"b1"backgroundViewState"b2"clearingBehavior"b2"overridePasscodeStyle"b1"shouldResignWithoutUpdate"b1"blurEnabled"b1"disableFocus"b1}
UITextField--->_deferringBecomeFirstResponder------B
UITextField--->_avoidBecomeFirstResponder------B
UITextField--->_setSelectionRangeAfterFieldEditorIsAttached------B
UITextField--->_animateNextHighlightChange------B
UITextField--->_baselineLayoutConstraint------@"NSLayoutConstraint"
UITextField--->_baselineLayoutLabel------@"_UIBaselineLayoutStrut"
- 获取iOS控件的隐藏属性
- iOS-获取控件的隐藏属性并修改
- 显示隐藏控件的属性
- android 控件的隐藏属性 .
- ios 控件的动画隐藏
- robotium android 自动化UI测试获取控件是否隐藏的属性
- Runtime获取对象隐藏的属性
- c#获取不到隐藏控件的值
- 隐藏组合控件的某个子控件属性问题
- iOS控件的动画显示与隐藏
- iOS获取屏幕的属性
- 自定义控件:属性隐藏等
- [VB.Net]Browsable的使用/隐藏或显示控件属性
- javascript 获取web控件的属性
- JQuery获取控件属性值的方法
- WPF--关于获取控件的属性
- ios的控件的AutoresizingMask属性
- ios的控件的AutoresizingMask属性
- Java 中关于String的空对象(null) ,空值(empty),空格 的总结
- [LuoguOJ][2330]Kruskal算法裸题:繁忙的都市
- Service详解
- UCOS2_STM32移植过程、系统内核、事件描述(汇总)
- 设计模式--代理模式--Java实现
- 获取iOS控件的隐藏属性
- 综合面试(hr面)常问的问题
- makefile:4: *** missing separator. Stop.
- 关于《effectivity Java》阅读笔记 01
- url="../movie/movie?id={{item.id}}"
- Android 下拉刷新库(最新)
- Oracle字符和时间比较[L]
- c++primer plus第十一章答案
- iOS中对字符串类型的金额进行格式化处理