【发布时间】:2015-07-27 12:32:18
【问题描述】:
我有一个带有 KenBurnsView 和 ImageView 的布局(只是一个切换按钮)。当我单击该按钮时,会生成一个 Ripple,但会在 KenBurnsView 下方绘制。
以前,当我用 Image 视图代替 KenBurnsView 时,波纹被绘制在顶部的 ImageView 上方。
这是我的布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:clickable="true"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_drawer_header_height">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.flaviofaria.kenburnsview.KenBurnsView
android:id="@+id/header_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cover_1" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/header_toggle"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:padding="10dp"
android:src="@drawable/toggle_down" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/nav_toggle_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></RelativeLayout>
</LinearLayout>
这是我的波纹可绘制 XML:
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@android:color/white"
android:drawSelectorOnTop="true"> <!-- ripple color -->
</ripple>
这就是我添加波纹的方式:
toggle.setBackground(getResources().getDrawable(R.drawable.ripple));
Ripple 在 KenBurnsView 下方得到 drwan 的问题是什么?当有一个 ImageView 代替 KenBurnsView 时,它曾经完美地工作?
【问题讨论】:
标签: android android-layout android-5.0-lollipop material-design