Android "Hello World" Layout Problem on Galaxy Tab Screen
Hi guys :)
I'm trying to run a simple "Hello World" program with a button and a textview. This is the layout:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_w开发者_如何学Cidth="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text"
android:layout_gravity="center_horizontal" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button"
android:layout_gravity="center_horizontal" />
</LinearLayout>
The problem is that it doesn't look good on the simulator with Samsung Galaxy Tab's resolution. The view doesn't take all available space as I wish but only a portion. Is "match_parent" correct in layout's width and height?
SOLUTION: add <uses-sdk android:minSdkVersion="4" />
in the manifest.xml
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
try this... it may work.
I think there should be fill_parent
精彩评论