Android视图 - 使一个视图对下面的视图透明
问题描述:
我正在努力使一个视图的背景透明,以便顶部视图上任何未绘制的区域实际上都会显示底部视图。Android视图 - 使一个视图对下面的视图透明
我已经在这里读过几个关于此的线程,但无论我尝试顶视图是用黑色绘制的。
两个底部图和俯视图是从查看基类的onDraw()被重写继承,这是我layout.xml:
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<com.domain.myapp.MyBottomView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mybottomview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bottom_image"/>
<com.domain.myapp.MyTopView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mytopview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"/>
</merge>
人有我有什么建议,我将非常感激!
问候 /迪
答
试试这个。
android:background="@android:color/transparent"
资源,请访问:http://android-developers.blogspot.in/2009/01/why-is-my-list-black-android.html
stackoverflow.com/questions/2176922/how-to-create-transparent-activity-in-android – xyz 2012-02-07 16:38:29
这实际上是有趣!它确实使活动透明而不是视图,但也许我可以使用它来获得更好的效果。 – Dee 2012-02-08 09:52:28