简体   繁体   中英

Google tv not displaying complete layout of my android application

I am trying to expand on a basic hello world application for the google tv. I have created a LinearLayout with a EditText and Button within it and put that under a very large 'Hello world' TextView (78sp). When I launch the application on the google tv box (adb), I get my 'Hello World' but only the very top of the EditText and Button.

Looking at the application within Eclipse Android Layout manager, its all fine and visible.

Any ideas on how to fix this?

I believe I must be missing some configuration element in all of this.

Any help appreciated. Thanks

code, my 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>

Probably because your first text view is 475dp high. You can see here that a TV is only 540dp high (remember that an actual pixel and a display independent pixel [dp] are not the same unless the screen is mdpi which no Google TV is)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM