mac*_*nix 7 android android-layout
我正在寻找一种方法将投影叠加到ScrollView上,如下所示:

我的目的是在滚动ScrollView内容的同时在ScrollView(绿色)上方和外部保留另一个布局.ScrollView顶部应该有一个阴影覆盖,看起来是上面的布局.
由于我希望ScrollView的内容滚动到投影中,因此该阴影不能是上面布局的一部分,否则投影将与下面的滚动内容保持分离.
有什么想法我怎么能把那个投影带到生活中?我发现android:前景但后来读到它在ScrollViews上不起作用.
mac*_*nix 10
好的,找到了解决方案.这就是我做的:
为了在ScrollView上叠加阴影图像,我将ScrollView放在FrameLayout中,并通过android:foreground将阴影drawable应用到FrameLayout.
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@drawable/drop_shadow_bitmap"
android:foregroundGravity="top|fill_horizontal" >
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top" >
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4396 次 |
| 最近记录: |