亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

自定義viewgroup時,報錯提示:沒有找到屬性rightpadding的資源標識符,求指導

自定義viewgroup時,報錯提示:沒有找到屬性rightpadding的資源標識符,求指導

andriod_2014 2015-01-08 17:17:25
xml文件中的引用:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"? ? xmlns:tools="http://schemas.android.com/tools"? ? xmlns:hyman="http://schemas.android.com/apk/res/com.imooc.slidingmenu"? ? android:layout_width="match_parent"? ? android:layout_height="match_parent" >已指明屬性的用法: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;}}attr.xml:<?xml version="1.0" encoding="utf-8"?><resources>? ? <attr name="rightPadding" format="dimension"></attr>? ? <declare-styleable name="SlidingMenu">? ? ? ? <attr name="rightPadding"></attr>? ? </declare-styleable></resources>mainfest中的包名也是正確的<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"? ? package="com.immoc.slidingmenu"? ? android:versionCode="1"? ? android:versionName="1.0" >? ? <uses-sdk? ? ? ? android:minSdkVersion="8"? ? ? ? android:targetSdkVersion="21" />? ? <application? ? ? ? android:allowBackup="true"? ? ? ? android:icon="@drawable/ic_launcher"? ? ? ? android:label="@string/app_name"? ? ? ? android:theme="@style/Theme.AppCompat.Light.NoActionBar" >? ? ? ? <activity? ? ? ? ? ? android:name="com.imooc.slidingmenu.MainActivity"? ? ? ? ? ? android:label="@string/app_name" >? ? ? ? ? ? <intent-filter>? ? ? ? ? ? ? ? <action android:name="android.intent.action.MAIN" />? ? ? ? ? ? ? ? <category android:name="android.intent.category.LAUNCHER" />? ? ? ? ? ? </intent-filter>? ? ? ? </activity>? ? </application></manifest>
查看完整描述

1 回答

?
圖文

TA貢獻3條經驗 獲得超0個贊

54ae5c2c00014d8005000250.jpg

改成這樣試試看

查看完整回答
反對 回復 2015-01-08
  • 1 回答
  • 0 關注
  • 3035 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號