簡體   English   中英

android表格布局的上邊距

[英]android table layout top margin

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
<TableLayout
    android:background="#000000"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:weightSum="0.95"
        android:layout_marginLeft="0.1dp"
        android:layout_marginBottom="0.1dp"
        android:layout_marginRight="0dp"
        android:layout_marginTop="0dp"
        >
        <EditText
            android:id="@+id/et_1"
            android:layout_weight="0.1"
            android:layout_marginRight="0.1dp"
            android:background="@color/color_white"
            android:layout_height="match_parent"
            android:layout_width="0dp"
            android:text="hell wolrd"
            android:inputType="text"

            />
        <EditText
            android:id="@+id/et_2"
            android:layout_weight="0.55"
            android:layout_marginTop="0dp"
            android:layout_marginRight="0.1dp"
            android:background="@color/color_white"
            android:layout_height="wrap_content"
            android:layout_width="0dp"
            android:paddingTop="5dp"
            android:text="hell wolrd"
            android:inputType="textCapSentences|textMultiLine"
            />
        <Spinner
            android:id="@+id/spinner_3"
            android:layout_weight="0.15"
            android:layout_marginRight="0.1dp"
            android:background="@color/color_white"
            android:layout_height="match_parent"
            android:layout_width="0dp"
            ></Spinner>
        <EditText
            android:id="@+id/et_4"
            android:layout_weight="0.15"
            android:layout_marginRight="0.1dp"
            android:background="@color/color_white"
            android:layout_height="match_parent"
            android:layout_width="0dp"
            android:inputType="text"
            />
    </TableRow>
</TableLayout>
</LinearLayout>

這是我的xml文件,顯示以下結果。

在此處輸入圖片說明

但是,當我運行代碼時,屏幕上將顯示以下內容:第二個編輯文本出現問題。 如果有人可以提供幫助,可能是什么原因? 這是保證金嗎? 當我不更改Class文件中的任何內容時,為什么會發生這種情況。

在此處輸入圖片說明

請更換

 android:layout_height="wrap_content"

在EditText(et_2)中

 android:layout_height="match_parent"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM