アクティビティ内のレイアウトのサイズを変更したい。ここでプログラムによるレイアウトのサイズ変更(アニメーションとして)
は、メインXMLのコードです:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/top"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#3ee3e3" >
</LinearLayout>
<LinearLayout
android:id="@+id/middle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:id="@+id/bottom"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#fe51e6" >
</LinearLayout>
</LinearLayout>
あなたが見ることができるように、上部と下部のレイアウトの高さのは0であり、中央の レイアウトはすべての場所をカバーしています。
すべてのレイアウトが同じ高さになるまで、中間のレイアウトサイズをプログラムで減らして、上部の と下部レイアウトサイズの両方を増やしたいとします。
アニメーションのように見えます。
どうすればよいですか?
おかげ
私はこれが素晴らしい[解決策]だと思います(http://stackoverflow.com/a/13381228/1276636)。 – Sufian
私は 'public void initialize'と' public boolean willChangeBounds'をオーバーライドする必要があると思います。 –
ありがとうございました! –