我的AS怎么不走這個(gè)方法?一直走沒有自定義屬性的那個(gè)
public SlidingMenu(Context context, AttributeSet attrs, int defStyle){
? ?super(context, attrs, defStyle);
? ?//獲取我們的屬性值
? ?TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SlidingMenu,
? ? ? ? ? ?defStyle,0);
? ?int n = a.getIndexCount();
? ?for (int i=0;i< n;i++){
? ? ? ?int attr = a.getIndex(i);
? ? ? ?switch (attr){
? ? ? ? ? ?case R.styleable.SlidingMenu_rightPadding:
? ? ? ? ? ? ? ?mMenuRightPadding = a.getDimensionPixelSize(attr,(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,50,context.getResources().getDisplayMetrics()));
? ? ? ? ? ? ? ?break;
? ? ? ?}
? ?}
2017-10-18
AS中,將activity的xml文件中的xmlns:hyman=“。。?!备臑閤mlns:hyman=“http://schemas.android.com/apk/res-auto
”即可