开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜