1

layout-small から layout-xlarge までのレイアウト フォルダーを実装しました。ただし、nexus 1 と nexus s の再生一時停止ボタンは自動的に配置され、外観が異なります。また、Galaxy nexus と samsung s3 ボタンの配置は異なります。ただし、どちらもデフォルトの通常の同じ xml を使用しています。両方のデバイスで同じように見えるようにアイテムを配置する方法を誰もが知っています...

こんな感じにしたい ここに画像の説明を入力

これが私のコードです

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/play_background"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/ff"
        android:layout_width="fill_parent"
        android:layout_height="350dp"
        android:scaleType="fitXY"
        android:src="@drawable/test_play_image" />

    <TextView
        android:id="@+id/metadata"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/ff"
        android:gravity="center"
        android:text="WUMM - D Light "
        android:textColor="@android:color/white"
        android:textSize="18dp" />

    <Button
        android:id="@+id/like"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:text="default Like" />

    <Button
        android:id="@+id/play"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/metadata"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="18dp"
        android:background="@drawable/ch_play" />

    <Button
        android:id="@+id/back"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/play"
        android:layout_alignBottom="@+id/play"
        android:layout_marginRight="30dp"
        android:layout_toLeftOf="@+id/play"
        android:background="@drawable/back" />

    <Button
        android:id="@+id/forward"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/play"
        android:layout_alignBottom="@+id/play"
        android:layout_marginLeft="40dp"
        android:layout_toRightOf="@+id/play"
        android:background="@drawable/forward" />

</RelativeLayout>    

しかし、IY は NEXUS ONE と S でこのように見えます。nexus 1 の画像は次のとおりです。 ここに画像の説明を入力

これがギャラクシーネクサスのスクリーンショットです ここに画像の説明を入力

4

1 に答える 1

0

最初にこのチュートリアルを実行します。ここでは、複数の画面サイズまたは解像度のサポートについて学習できます。

画面サポート

画面サイズのサポート

複数画面用の画像、アイコンのデザイン

于 2012-10-29T16:36:54.557 に答える