第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

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

54ae419c0001365b05000087.jpg


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>


正在回答

2 回答

你好,從你貼出的代碼,看起來沒有問題,建議把項目clean,或者close Project 在 open Project 嘗試下。

0 回復 有任何疑惑可以回復我~

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>


0 回復 有任何疑惑可以回復我~
#1

mandy

你的xmlns中是com.imooc.slidingmenu Project的包名是com.immoc.slidingmenu
2015-02-02 回復 有任何疑惑可以回復我~
#2

由木 回復 mandy

好眼力?。。?!
2015-12-15 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
QQ5.0側滑菜單
  • 參與學習       62515    人
  • 解答問題       304    個

本教程將帶領大家通過自定義控件實現QQ5.0側滑菜單

進入課程

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

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號

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