ScrollView http://dl.dropbox.com/u/3216968/ScrollView%20problem.png
我有一个包含LinearLayout的ScrollView。我有两个我想要实现的自定义。
[1] 如何去除顶部的黑色阴影? 试图查看Why is my List black Android,但这仅适用于ListView并讨论背景。
[2] 当我尝试为LinearLayout制作摇动动画时,动画不显示在线外。尝试了很多不同的东西,并开始认为是不可能的。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView_response"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:background="@color/transparent"
android:fillViewport="true"
android:fadingEdge="none" >
<LinearLayout android:id="@+id/LinearLayout_response"
android:background="@drawable/background_red"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_height="match_parent"
android:minWidth="270dp"
>
这是活动代码
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.manual_resonse_layout);
Animation shakeIn = AnimationUtils.loadAnimation(this, R.anim.shake_in);
LinearLayout mainView = (LinearLayout) findViewById(R.id.LinearLayout_response);
mainView.startAnimation(shakeIn);
答案 0 :(得分:0)
至于顶部的“黑影”,将ScrollView android:fadingEdge XML属性设置为“none”应该这样做。
答案 1 :(得分:0)
为了使摇动动画有效,你的线性布局需要设置一些边距,以便它有足够的“空间”来摇晃。您可以使滚动视图填充屏幕宽度和线性布局较小并放置在中间等。
关于影子,这是一个很好的问题!