私のアプリでは、フッターになるフラグメントのコンテナーとして次の FrameLayout を使用します。
<FrameLayout
android:id="@+id/frameLayoutFooter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
私のアクティビティでは、フラグメントを追加するために次のコードを使用します。
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
mFooterFragment = new FooterFragment();
ft.add(R.id.frameLayoutFooter, mFooterFragment);
ft.commit();
私のフッターフラグメントのレイアウトは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/footerContainer"
android:layout_width="fill_parent"
android:layout_height="165dip"
android:layout_alignParentBottom="true"
android:background="#15355b" >
<RelativeLayout
android:id="@+id/relativeLayoutTopSetcion"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
..... some buttons and imageviews here...
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayoutBottomSetcion"
android:layout_width="fill_parent"
android:layout_height="350dip"
android:layout_alignParentBottom="true"
android:visibility="**invisible**" >
..... some more imageviews and textviews here...
</RelativeLayout>
</RelativeLayout>
ある時点で、フッターを展開してイメージビューとテキストビューを追加したいと考えていますが、残念ながらすべての試行が失敗しました。その結果、フラグメントの FrameLayoutは展開されますが、その子は上部 (古い下部) の部分にとどまります。 alignParentBottom が true に設定されていても、フッターの高さが変化し、新しく追加された下部が透明になっているため、その子が新しいレイアウト パラメータで更新されていないと思います。 もう 1 つのことは、mRelativeLayoutBottomSetcion.setVisibility(View.VISIBLE) の変更が見られることですが、FrameLayout の下部 (新しく展開されたセクション) ではなく、展開前の元のサイズの下部にあります。
フラグメントを展開するために、この framents が属するアクティビティから次のコードを使用しました。
ViewGroup.LayoutParams params = mFrameLayoutFooter.getLayoutParams();
params.height = 500;
mFrameLayoutFooter.requestLayout();
// setting the bootom relative layout to be visible
mRelativeLayoutBottomSetcion.setVisibility(View.VISIBLE);
私は何を間違っていますか?
消耗品フッターの既知の UI パターンはありますか?
前もって感謝します