0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lyt_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/plain_bg"
android:orientation="vertical" >

<LinearLayout
    android:id="@+id/lyt_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <include
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/header" />
</LinearLayout>

<LinearLayout
    android:id="@+id/lyt_body"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/lyt_Buttons"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/imgfrontlogo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/imgcenterlogo"
            android:layout_alignParentTop="true"
            android:layout_marginTop="61dp"
             android:background="@drawable/front_logo"
             />

        <ImageView
            android:id="@+id/imgcenterlogo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/btnPersonaltrainer"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="29dp"
            android:background="@drawable/center_logo" />

        <Button
            android:id="@+id/btnMyProfile"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_marginBottom="21dp"
            android:layout_marginLeft="32dp"
            android:background="@drawable/myprofile" />

        <Button
            android:id="@+id/btnTaracker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imgcenterlogo"
            android:layout_alignParentRight="true"
            android:layout_marginBottom="49dp"
            android:background="@drawable/track" />

        <Button
            android:id="@+id/btnPersonaltrainer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/btnMyProfile"
            android:layout_alignLeft="@+id/btnAllExercises"
            android:background="@drawable/personaltrainer" />

        <Button
            android:id="@+id/btnRandomworkouts"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/btnPersonaltrainer"
            android:layout_alignParentLeft="true"
            android:background="@drawable/randomworkout" />

        <Button
            android:id="@+id/btnAllworkouts"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@+id/btnAllExercises"
            android:layout_alignBottom="@+id/btnAllExercises"
            android:layout_alignLeft="@+id/btnMyProfile"
            android:background="@drawable/allworkouts" />

        <Button
            android:id="@+id/btnAllExercises"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/btnTaracker"
            android:layout_alignParentRight="true"
            android:layout_marginRight="40dp"
            android:background="@drawable/allexercises" />

            </RelativeLayout>
            </LinearLayout>

            </LinearLayout>`

すべての画面サイズに対応するレイアウトを作成する必要があり、特大サイズ (800x1280、720x1280 など) 用に別のレイアウトを作成しました。ここでは、評判のために画像をアップロードできません。レイアウトの中央に 1 つのメイン ボタンを配置し、中央のボタンの左右に 3 つのボタンを曲線的に配置する必要があります。 dp または固定点を使用します。

4

2 に答える 2

0

属性を使用できandroid:layout_weightます。パーセンテージを使用してボタンを定義できるようになります。

例:

  <LinearLayout
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:weightSum="1.0" >

    <Button
        android:text="left" 
        android:layout_width="0dp" 
        android:layout_height="wrap_content" 
        android:layout_weight=".50" /> 

    <Button
        android:text="right" 
        android:layout_width="0dp" 
        android:layout_height="wrap_content" 
        android:layout_weight=".50" />

</LinearLayout>

ボタンにパーセンテージ値を指定したので、どのサイズの画面でも画面全体のパーセント値に表示されます。

これは、このリンクの2番目の回答を確認するLinearLayoutために実行できますRelativeLayout

于 2013-04-24T05:58:54.380 に答える
0

ボタンを中央のボタンの左右に曲線的に配置したいという質問で述べたように、リンクを見て、これを達成する方法についていくつかのアイデアを得ることができます: https://github.com/daCapricorn/ ArcMenu これはパスのようなメニューを作成するために参照したオープン ソース プロジェクトです。

于 2013-04-25T06:39:05.623 に答える