LineatLayout を画面の下部に配置したい。この LineraLayout は、親 Linearlayout 内にあります。私は画面の高さを取得し、それに応じて、setTop() 内にどのような値が入っているかを知っています。しかし setTop() は何もしません。onCreate メソッドではなく、ボタンをクリックした後に setTop を使用するので、メイン レイアウトは完全に読み込まれます。
使用しようとしまし
LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(width,height);
たが、この場合 setTop メソッドはありません。
これが今の私のレイアウトです
これが私が達成したいことです
これは私のxmlファイルの一部です
<!-- parent-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@xml/background_generale"
android:gravity="top|right|center"
android:orientation="vertical"
tools:context=".MainActivity" >
<!-- child-->
<LinearLayout
android:id="@+id/layoutBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/mainLayoutRaddoppiaBackground"
android:gravity="bottom|center_horizontal"
android:weightSum="1" >
...here there are the 4 buttons you can see in the image...
<!-- end child-->
</LinearLayout>
<!-- end parent-->
</LinearLayout>
私は何をすべきか?