Apps only run in part of the screen?
I just started Android development and I'm ha开发者_开发技巧ving this issue where the app runs in only part of the screen. apparently this has happened to other people but I can't find a solution.
Here's part of my XML:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/gaben"
>
<TableLayout
android:id="@+id/tablelayout1"
android:layout_width="312px"
android:layout_height="429px"
android:orientation="vertical"
>
<Button
android:id="@+id/welcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to TF2"
android:onClick="welcome"
>
</Button>
...
Can anyone help? Thanks!
android:layout_width="312px"
android:layout_height="429px"
this means your table
width and height set to specific value less than screen size.
must be set fillparent
, so like this:
android:layout_width="fillparent"
android:layout_height="fillparent"
and try to add android:fillViewport="true"
to your ScrollView
精彩评论