有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java安卓表布局问题

我不知道为什么我对Android的布局感到如此困难。这是我的3个不同的布局。哈哈

我使用的是表格布局,但我的按钮、textview和微调器都被拉伸到远离屏幕的位置:

<?xml version="1.0" encoding="utf-8"?>

<TableLayout    
    安卓:layout_width="fill_parent" 
    安卓:layout_height="fill_parent" 
    xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
    安卓:background="@drawable/par_mainbg">


<TableRow>

    <TextView 
  安卓:id="@+id/introtext"
  安卓:padding="15px"
  安卓:textSize="16dp"
  安卓:textColor="#000000"
  安卓:text="@string/intro"/>
</TableRow>

<TableRow>
<Spinner 
安卓:id="@+id/areaspinner"
安卓:layout_height="40dip"
安卓:drawSelectorOnTop="true"
安卓:gravity="center_horizontal"
安卓:layout_y="300px"
安卓:padding="5dip"
安卓:paddingLeft="10dip"
安卓:textSize="25dp"
安卓:prompt="@string/select_prompt"
/> 

</TableRow>

<TableRow>

<Button
安卓:id="@+id/goButton"
安卓:layout_height="wrap_content"
安卓:text="@string/subscribe"
安卓:textSize="19dp">
</Button>
</TableRow>


</TableLayout>

您还可以使用Valign(html)将下表行推到底,而不管屏幕大小如何


共 (0) 个答案