我在我的XML文件中使用了三个微调器.想要更改微调器颜色,直到按下下一个微调器.
这是我使用的xml:
<Spinner
android:id="@+id/spinner13"
android:drawSelectorOnTop="true"
android:background="@drawable/mybg"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:textColor="#0000FF" />
<Spinner
android:id="@+id/spinner23"
android:drawSelectorOnTop="true"
android:background="@drawable/mybg"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:textColor="#0000FF" />
<Spinner
android:id="@+id/spinner33"
android:drawSelectorOnTop="true"
android:background="@drawable/mybg"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:textColor="#0000FF"/>
Run Code Online (Sandbox Code Playgroud)
这是mybg.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@style/AppBaseTheme.Yellow"/>
<item android:state_selected="true" android:drawable="@style/AppBaseTheme.Yellow" />
</selector>
Run Code Online (Sandbox Code Playgroud)
风格:
<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>
<style name="AppBaseTheme.Yellow">
<item name="android:background">#FFAA00</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud) 我通过Intent.its调用ACTION_LOCATION_SOURCE_SETTINGS显示无法解析或不是从外部导入Project时导致的字段.我现在应该怎么做 ?
Intent viewIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(viewIntent);
Run Code Online (Sandbox Code Playgroud)