0

Google TV の基本的な Hello World アプリケーションを拡張しようとしています。EditText と Button を含む LinearLayout を作成し、それを非常に大きな 'Hello world' TextView (78sp) の下に配置しました。Google tv ボックス (adb) でアプリケーションを起動すると、「Hello World」が表示されますが、EditText とボタンの一番上しか表示されません。

Eclipse Android Layout Manager 内のアプリケーションを見ると、すべて問題なく表示されています。

これを修正する方法についてのアイデアはありますか?

このすべてにおいて、いくつかの構成要素が欠けているに違いないと思います。

どんな助けでも感謝します。ありがとう

コード、私のmain.xml:

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

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="475dp"
        android:gravity="center"
        android:text="@string/hello"
        android:textSize="78sp" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <EditText
            android:id="@+id/edit_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10"
            android:hint="@string/edit_message" >

            <requestFocus />
        </EditText>

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

            android:text="@string/button_send" />

    </LinearLayout>

</LinearLayout>
4

1 に答える 1

2

おそらく、最初のテキスト ビューの高さが 475 dp であるためです。ここで、TV の高さが 540 dp しかないことがわかります(Google TV ではない画面が mdpi でない限り、実際のピクセルとディスプレイに依存しないピクセル [dp] は同じではないことに注意してください)。

于 2012-06-26T19:45:32.387 に答える