首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

关于R.styleable的有关问题

2012-08-31 
关于R.styleable的问题原来想直接想调用程序的东西,但是使用R.styleable的时候 eclipse不能解析了,后来发

关于R.styleable的问题

原来想直接想调用程序的东西,但是使用R.styleable的时候 eclipse不能解析了,后来发现原来被删除了此方法

public ImageAdapter(Context c) {? ? mContext = c;? ? TypedArray a = c.obtainStyledAttributes(R.styleable.Gallery1);? ? mGalleryItemBackground = a.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 0);? ? a.recycle();}

唯一要做的就是自己去做一个styleable

res\values

<?xml version="1.0" encoding="utf-8"?> <resources> ? ? <declare-styleable name="Gallery1"> ? ? ? ? <attr name="android:galleryItemBackground" /> ? ? </declare-styleable> </resources>

热点排行