需要使TextView出现在TableLayout的同一行中的EditBox旁边

|| 我搜寻了论坛和Google,试图找出我在这里做错了什么。我希望TextView出现在同一行的EditText之前。我尝试使用TableLayout进行此操作,但结果是EditText以纵向方向从屏幕上推下,而在横向方向上几乎看不到它。到目前为止,这是我的代码:
    <?xml version=\"1.0\" encoding=\"utf-8\"?>
<Button android:layout_width=\"wrap_content\"
    android:layout_alignParentTop=\"true\" android:layout_alignParentRight=\"true\"
    android:layout_marginBottom=\"20dip\" android:layout_height=\"wrap_content\"
    android:id=\"@+id/about_button\" android:text=\"@string/about_label\" />

    <TextView android:text=\"@string/deck_size_label\"
    android:layout_width=\"fill_parent\"
    android:layout_height=\"wrap_content\"
    android:layout_marginBottom=\"20dip\" android:textSize=\"24.5sp\"
    android:layout_alignParentLeft=\"true\" 
    android:layout_below=\"@id/about_button\"/> 

    <EditText
    android:id=\"@+id/deck_size_textbox\" android:inputType=\"number\"
    android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"
    android:layout_alignParentRight=\"true\"
    android:layout_toRightOf=\"@id/about_button\" /> 
                                   -> 任何帮助,将不胜感激。     
已邀请:
        如果TextView中的文本太宽,它将把EditText推离屏幕。您 可以使用layout_weight强制TextView和EditText平等地分割可用宽度,如下所示:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"
    android:layout_width=\"match_parent\"
    android:layout_height=\"wrap_content\"
    android:orientation=\"horizontal\"
    >
    <TextView
        android:text=\"@string/land_count_label\"
        android:layout_height=\"wrap_content\"
        android:layout_width=\"0dp\"
        android:layout_weight=\"1\"
        android:gravity=\"left\"
        android:layout_marginBottom=\"20dip\"
        android:textSize=\"24.5sp\"
        />
    <EditText
        android:id=\"@+id/land_count_textbox\"
        android:inputType=\"number\"
        android:layout_width=\"0dp\"
        android:layout_weight=\"1\"
        android:layout_height=\"wrap_content\"
        />
</LinearLayout>
您可能可以使用RelativeLayout获得更好的控制。     
        您是否尝试过RelativeLayout?如果您定义的RelativeLayout中具有水平放置的LinearLayout(用于行),则可以定义XML属性,例如:
android:layout_toRightOf=\"@id/idoftextviewhere\"
如果仍在将EditText框从屏幕上移开,请尝试实施以下方法:
android:layout_alignParentRight
    

要回复问题请先登录注册