I have a xml-layout that consists two FrameLayouts(f1 and f2). F1 fills all screen s area, and f2 is hided under the screen by using android:layout_marginBottom="-900dp". Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/llMainLayout"
android:orientation="vertical">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/f1" android:background="@color/white">
<fragment
android:id="@+id/leftsidefragment"
android:name="de.com.fragments.ChapterDescriptionPageFragment"
android:layout_width="match_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/flRightWindowPart"
android:background="@android:color/transparent"
android:layout_gravity="bottom">
<fragment
android:id="@+id/f2"
android:name="de.com.fragments.ChapterSubchaptersListFragmentWithHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
</FrameLayout>
</LinearLayout>
然后我做了翻译动画:f2正在上升。除了一个问题——f2在动画中不可见外,所有工作都很好。构造动画的方法代码:
public Animation constructSlideUpAnimation(boolean inverse){
if (inverse)
return new TranslateAnimation(
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f,
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 900
);
else
return new TranslateAnimation(
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f,
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, -900
);
}
Write if you need some others chunks of code. I really appreciate any help. Thanks in advance.