Android 安卓微调器模式:是";资源id 0x1010081不是类型样式(而是attr)";安全吗?
我正在使用微调器:Android 安卓微调器模式:是";资源id 0x1010081不是类型样式(而是attr)";安全吗?,android,android-layout,android-spinner,Android,Android Layout,Android Spinner,我正在使用微调器: <Spinner android:id="@+id/spinner" android:layout_width="60dp" android:layout_height="30dp" android:layout_alignBottom="@+id/text" android:layout_marginLeft="10dp" android:layout_marginStart="10dp" android:lay
<Spinner
android:id="@+id/spinner"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_alignBottom="@+id/text"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="@+id/text"
android:layout_toRightOf="@+id/text"
android:gravity="center|center_horizontal"
android:popupBackground="@color/spinner_pop"
android:spinnerMode="dropdown" />
上面的代码显示了一条消息资源id 0x1010081不是类型样式(而是attr),但没有作为错误提及
我已经试着运行这段代码,而布局正是我想要的,我没有得到任何错误
我已经搜索过了,但是我找不到合适的解决方案来删除xml布局的图形布局视图中的消息
这在我的项目中不起作用
问题是,我当前的布局将来会产生问题吗?
我在EclipseKepler中运行这个,Android API级别为19
应用程序将仅在API级别16及以上运行
编辑:
如果我将构建布局的Api级别更改为20或更高,消息就会消失。该消息仅在我使用API级别19及以下时显示
试试这个
<Spinner
android:id="@+id/spBloodbanks"
style="@style/Widget.AppCompat.Light.DropDownItem.Spinner"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="45dp"
/>
试试这个
<Spinner
android:id="@+id/spBloodbanks"
style="@style/Widget.AppCompat.Light.DropDownItem.Spinner"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="45dp"
/>
附上的屏幕截图error@Survivor我添加了屏幕截图。您是否尝试在android:popupBackground=“@color/spinner\u pop”android:spinnerMode=“dropdown”删除此行?我的要求是spinnerMode=“dropdown”,因此无法删除。虽然删除该行只能解决消息问题。man但它在API级别19中不可用,因此如果您实际需要它,则会出现错误,然后使用//为spinner ArrayAdapter创建适配器dataAdapter=new ArrayAdapter(此,android.R.layout.simple_spinner_项,类别);//下拉布局样式-带有单选按钮dataAdapter.setDropDownViewResource(android.R.layout.simple_微调器_下拉项)的列表视图;//将数据适配器连接到微调器微调器。setAdapter(dataAdapter)代码>programmaticallyattach的屏幕截图error@Survivor我添加了屏幕截图。您是否尝试在android:popupBackground=“@color/spinner\u pop”android:spinnerMode=“dropdown”
删除此行?我的要求是spinnerMode=“dropdown”,因此无法删除。虽然删除该行只能解决消息问题。man但它在API级别19中不可用,因此如果您实际需要它,则会出现错误,然后使用//为spinner ArrayAdapter创建适配器dataAdapter=new ArrayAdapter(此,android.R.layout.simple_spinner_项,类别);//下拉布局样式-带有单选按钮dataAdapter.setDropDownViewResource(android.R.layout.simple_微调器_下拉项)的列表视图;//将数据适配器连接到微调器微调器。setAdapter(dataAdapter)代码>以编程方式