R.styleable不能得到解决 [英] R.styleable cannot be resolved
本文介绍了R.styleable不能得到解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
海的朋友......我的Java文件指出这个错误:
R.styleable解决不了的....
我的xml文件:
<?XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:方向=垂直
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT><画廊的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:ID =@ + ID / videoGrdVw
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
机器人:为numColumns =auto_fit
机器人:verticalSpacing =5dip
机器人:horizontalSpacing =5dip
机器人:columnWidth时=80dip
机器人:stretchMode =columnWidth时
机器人:比重=中心/> < ImageSwitcher 机器人:ID =@ + ID /切换器
机器人:layout_height =match_parent
机器人:layout_width =match_parent> < / ImageSwitcher>
<资源>
<申报-设置样式名称=HelloGallery>
< attr指示名=机器人:galleryItemBackground/>
< /申报,设置样式>
< /资源>
< / LinearLayout中>
源$ C $ C:
私有类VideoGalleryAdapter延伸BaseAdapter
{
私人诠释itemBackground; 公共VideoGalleryAdapter(上下文C)
{
_context = C;
TypedArray A = obtainStyledAttributes(R.styleable.Gallery1);
itemBackground = a.getResourceId(
R.styleable.Gallery1_android_galleryItemBackground,0);
a.recycle();
}
解决方案
对于我来说,这样做有问题:
进口android.R;
hai friends...my java file indicate this error: R.styleable cannot be resolved....
my xml file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/videoGrdVw"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="auto_fit"
android:verticalSpacing="5dip"
android:horizontalSpacing="5dip"
android:columnWidth="80dip"
android:stretchMode="columnWidth"
android:gravity="center"/>
<ImageSwitcher
android:id="@+id/switcher"
android:layout_height="match_parent"
android:layout_width="match_parent">
</ImageSwitcher>
<resources>
<declare-styleable name="HelloGallery">
<attr name="android:galleryItemBackground" />
</declare-styleable>
</resources>
</LinearLayout>
source code:
private class VideoGalleryAdapter extends BaseAdapter
{
private int itemBackground;
public VideoGalleryAdapter(Context c)
{
_context = c;
TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);
itemBackground = a.getResourceId(
R.styleable.Gallery1_android_galleryItemBackground, 0);
a.recycle();
}
解决方案
For me, this did the trick:
import android.R;
这篇关于R.styleable不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文