0

私はAndroidの初心者です。Eclipse を使用してアプリをプログラムします。.xml クラスを作成し、ボタンの特定の位置を設定する場合、たとえば次のコードを使用します。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/fm"
    android:baselineAligned="false"
    android:gravity="end" >

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:scrollX="100dp"
    android:scrollY="30dp"
    android:text="@string/edad" />

</RelativeLayout>

...しかし、何も起こりません。ボタンを隅に配置します。他の場所に表示するにはどうすればよいですか?

4

4 に答える 4

0
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:layout_marginLeft="100dp"
android:layout_marginTop="30dp"
android:text="@string/edad" />
于 2012-10-18T22:19:03.393 に答える
0

ボタンをクリックしてプロパティに移動する必要があります。そこに、さまざまなポジショニング設定があります。以下の例:@+id/VIEW 次に、marin top : 10dip を設定します。これにより、VIEW の下にボタン 10 ディップが設定されます。

于 2012-10-18T22:05:00.417 に答える
0

使用する必要があります

android:layout_marginRight
android:layout_marginLeft 
android:layout_marginTop
android:layout_marginBottom 
于 2012-10-18T22:02:22.460 に答える
0

android:layout_below などの配置パラメーターを使用する必要があります。詳細については、相対レイアウト ガイドを参照してください。

于 2012-10-18T22:02:34.077 に答える