我有一个非常简单的布局:带有MapView和ToggleButton的RelativeLayout。为什么当我没有在任何地方指定它时,ToggleButton显示为透明,真正的问题是,我怎样才能使它停止?Android - 谷歌地图上的透明ToggleButton
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="NoYouCantSeeMyKey" />
<ToggleButton android:id="@+id/aerialsbutton"
android:layout_width="150px"
android:layout_height="50px"
android:textOn="Aerials On"
android:textOff="Aerials Off"
android:layout_alignParentRight="true" />
</RelativeLayout>
我试过设置阿尔法为1,并且没有运气切换的MapView和切换按钮的顺序。任何帮助深表感谢。
更新:我有我的Applcation主题设置为android:theme="@android:style/Theme.Holo.NoActionBar"
。这可能吗?
更新2:主题没有区别。在这里很难过。
你试过 android:disabledAlpha 属性? –
它没有帮助,也不应该因为我的ToggleButton没有被禁用。 – Gady
你可以给setBackgroundDrawable(Drawable d) – Hanry