Android 未生成XML文件(或未更新R文件)
我开始这个新问题是因为我的老问题()实际上已经完全偏离了主题,因为我在这个问题上的评论者的帮助下有了新的发现。所以问题是:我的XML文件没有被构建,或者R文件没有被更新。当Eclipse尝试呈现XML文件时,会出现以下错误: 资源id 0x1010081不是类型样式(而是attr) 经过一些研究,我发现这可能与微调器样式有关,我尝试完全移除微调器,但应用程序仍然显示微调器(以及我很久以前移除的按钮)。我目前在项目中没有错误,或者我作为库引用的任何项目中都没有错误。我已经试着清理我的项目十几次了,但还是一无所获。有人知道会发生什么吗 对于XML文件中的一些细节,以下是全部XML代码:Android 未生成XML文件(或未更新R文件),android,xml,eclipse,Android,Xml,Eclipse,我开始这个新问题是因为我的老问题()实际上已经完全偏离了主题,因为我在这个问题上的评论者的帮助下有了新的发现。所以问题是:我的XML文件没有被构建,或者R文件没有被更新。当Eclipse尝试呈现XML文件时,会出现以下错误: 资源id 0x1010081不是类型样式(而是attr) 经过一些研究,我发现这可能与微调器样式有关,我尝试完全移除微调器,但应用程序仍然显示微调器(以及我很久以前移除的按钮)。我目前在项目中没有错误,或者我作为库引用的任何项目中都没有错误。我已经试着清理我的项目十几次了,
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:geekui="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#111"
android:orientation="vertical"
android:weightSum="100" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#111" >
<ViewSwitcher
android:id="@+id/ccclan_viewSwitcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/cclan_background_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<View
android:id="@+id/cclan_background_bar_light"
android:layout_width="fill_parent"
android:layout_height="90dp"
android:background="#1b1b1b" >
</View>
</LinearLayout>
<LinearLayout
android:id="@+id/cclan_mainlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="100" >
<ImageView
android:id="@+id/cclan_clanImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp" />
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_upload_button"
style="@style/RobotoButton"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="15dp"
android:layout_marginTop="45dp"
android:background="@drawable/button_standard_selector"
android:text="Upload clan image"
android:textColor="#dedede" />
<EditText
android:id="@+id/cclan_edittext_clanName"
style="@style/ClansterEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:background="@drawable/clanster_edit_text_holo_dark"
android:ems="10"
android:hint="Clan Name"
android:imeOptions="actionNext"
android:singleLine="true"
android:textColor="#dedede" >
<requestFocus />
</EditText>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:weightSum="100" >
<AutoCompleteTextView
android:id="@+id/cclan_edittext_gameName"
style="@style/ClansterEditText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_weight="85"
android:background="@drawable/clanster_edit_text_holo_dark"
android:completionThreshold="1"
android:ems="10"
android:hint="Game Name"
android:imeOptions="actionNext"
android:singleLine="true"
android:textColor="#dedede" >
</AutoCompleteTextView>
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_addgame_button"
style="@style/RobotoButton"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_weight="15"
android:background="@drawable/button_standard_selector"
android:text="+"
android:textColor="#dedede" >
</com.timkranen.extra.RobotoButton>
</LinearLayout>
<EditText
android:id="@+id/cclan_edittext_clanDescr"
style="@style/ClansterEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:background="@drawable/clanster_edit_text_holo_dark"
android:ems="10"
android:hint="Clan Description"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:maxLines="3"
android:textColor="#dedede" >
</EditText>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" >
<com.timkranen.extra.TypefaceTextView
android:id="@+id/typefaceTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:text="Open Membership: "
android:textColor="#dedede"
geekui:customTypeface="fonts/ROBOTO-THIN.TTF" />
<ToggleButton
android:id="@+id/memberToggle"
style="@style/ToggleClansterToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test Text"
android:textOff="OFF"
android:textOn="ON" />
</LinearLayout>
<LinearLayout
android:id="@+id/cclan_optionslayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" >
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_cancel_button"
style="@style/RobotoButton"
android:layout_width="150dp"
android:layout_height="50dp"
android:background="@drawable/button_left_selector"
android:text="Cancel"
android:textColor="#dedede" />
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_ok_button"
style="@style/RobotoButton"
android:layout_width="150dp"
android:layout_height="50dp"
android:background="@drawable/button_right_selector"
android:text="OK"
android:textColor="#dedede" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<RelativeLayout
android:id="@+id/wrapSelectionLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/cclan_gameLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/cclan_addGameLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="150dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible" >
<com.timkranen.extra.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Add new game"
android:textColor="#dedede"
android:textSize="22sp"
geekui:customTypeface="fonts/ROBOTO-THIN.TTF" />
<EditText
android:id="@+id/cclan__addgame_title"
style="@style/ClansterEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@drawable/clanster_edit_text_holo_dark"
android:ems="10"
android:hint="Game Title"
android:imeOptions="actionNext"
android:singleLine="true"
android:textColor="#dedede" >
</EditText>
<AutoCompleteTextView
android:id="@+id/cclan_addgame_platform"
style="@style/ClansterEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@drawable/clanster_edit_text_holo_dark"
android:ems="10"
android:hint="Platform"
android:imeOptions="actionNext"
android:singleLine="true"
android:textColor="#dedede" >
</AutoCompleteTextView>
<LinearLayout
android:id="@+id/cclan_addGameLayout_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_addgame_cancel"
style="@style/RobotoButton"
android:layout_width="130dp"
android:layout_height="36dp"
android:background="@drawable/button_left_selector"
android:text="Cancel"
android:textColor="#dedede" />
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan_addgame_ok"
style="@style/RobotoButton"
android:layout_width="130dp"
android:layout_height="36dp"
android:background="@drawable/button_right_selector"
android:text="OK"
android:textColor="#dedede" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/cclan_choosePlatformLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="150dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="invisible" >
<com.timkranen.extra.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:text="What platform do you play on?"
android:textColor="#dedede"
android:textSize="22sp"
geekui:customTypeface="fonts/ROBOTO-THIN.TTF" />
<Spinner
android:id="@+id/cclan_platformSpinner"
style="@style/Spinnerclanster"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.timkranen.extra.RobotoButton
android:id="@+id/cclan__confirm"
style="@style/RobotoButton"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:background="@drawable/button_standard_selector"
android:text="Confirm"
android:textColor="#dedede" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/cclan_choosePlatformLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="150dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone" >
<com.timkranen.extra.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
android:text="What platform does your clan play on?"
android:textColor="#dedede"
android:textSize="22sp"
geekui:customTypeface="fonts/ROBOTO-THIN.TTF" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
</ViewSwitcher>
</ScrollView>
编辑:我一整天都在想这个问题。还没有任何效果,我尝试创建一个新项目,并将旧项目类移动到新项目中,但也没有效果。我怀疑它在XML文件中,但我不知道在哪里
编辑:我的天啊,我觉得自己很愚蠢。经过数小时的搜索和谷歌搜索,我终于找到了错误。我在文件中有两次相同的布局。双ID和一切..在xml中使用的样式似乎有问题。由于所有这些都是自定义样式,因此很难预测实际问题是否是由于某些错误的样式格式造成的 解决方案1- 尝试将每个自定义样式替换为通用样式,如-
style="?attr/text_large_bold_white"
解决方案2-
我找到了一本很好的读物,上面说将微调器模式替换为“对话框”。你可以试试
它还表明-
所讨论的id指的是android属性spinnerStyle。请参阅文档了解R.attr
解决办法是替换
android:spinnerMode="dropdown"
与
源:.您是否尝试清理和重建项目?@G.T.是的,多次,但都没有解决问题。您的布局在Eclipse的图形布局中是最新的吗?@G.T.如上所述,图形布局由于错误而无法呈现:资源id 0x1010081不是类型样式(而不是attr)@Frank N.Stein我正在尝试用小写字母替换字体名称,看看是否有效。编辑:它没有解决这个问题。我已经读过了,所以线程,我已经尝试实现这些解决方案,但没有结果。谢谢你的帮助。
android:spinnerStyle="@android:style/Widget.Spinner.DropDown".