久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

編輯文本標簽?

EditText Label?(編輯文本標簽?)
本文介紹了編輯文本標簽?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我想要一些像這樣的布局

I want to have some layout a bit like this

[text tabel][edittext]

我找不到像 html esque 標簽這樣的屬性.似乎是我需要使用的情況

i cant find an attribute like html esque label. It seems to be the case that i need to use

[TextView][EditText]

但我不能讓他們在同一行這是我的 xml 文件.

but i cant get them to go on the same line this is my xml file.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">"
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/boat_1"/>
<EditText
    android:id="@+id/entry"
    android:hint="@string/IRC"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:drawable/editbox_background"/>
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/boat_2"/>
<EditText
    android:id="@+id/entry"
    android:hint="@string/IRC"
    android:minWidth="100dip"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:drawable/editbox_background"/>
<Button android:id="@+id/close"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:text="@string/title_close" />

推薦答案

你基本上有兩種選擇:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"> 
<LinearLayout
android:orientation="horizontal" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content">
<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/boat_1"/> 
<EditText 
    android:id="@+id/entry" 
    android:hint="@string/IRC" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@android:drawable/editbox_background"/> 
</LinearLayout>
<LinearLayout
android:orientation="horizontal" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content">
<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/boat_2"/> 
<EditText 
    android:id="@+id/entry" 
    android:hint="@string/IRC" 
    android:minWidth="100dip" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@android:drawable/editbox_background"/> 
</LinearLayout>
<Button android:id="@+id/close" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:text="@string/title_close" /> 

請注意,我將 android:orientation="horizo??ntal" 用于那些嵌套布局.

Notice that I'm using android:orientation="horizontal" for those nested layouts.

這樣做的好處是您可以避免嵌套,因此您的布局將更容易閱讀/維護/膨脹.這是一個簡單的例子:

The advantage of this, is that you can avoid nesting, thus your layout will be easier to read/maintain/inflate. This is a brief example:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content">
    <TextView 
        android:id="@+id/text_view_boat1"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/boat_1"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"/> 
    <EditText 
        android:id="@+id/entry" 
        android:hint="@string/IRC" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@android:drawable/editbox_background"
        android:layout_toRightOf="@+id/text_view_boat1"
        android:layout_alignParentTop="true"/> 
    <TextView 
        android:id="@+id/text_view_boat2"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/boat_2"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/text_view_boat1"/> 
    <EditText 
        android:id="@+id/entry2" 
        android:hint="@string/IRC" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@android:drawable/editbox_background"
        android:layout_toRightOf="@+id/text_view_boat2"
        android:layout_below="@id/entry"/> 
</RelativeLayout>

這篇關于編輯文本標簽?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 国产精品99精品久久免费 | 日韩成人精品视频 | 在线看av网址 | 国精久久 | 啪视频在线 | 91精品国产美女在线观看 | 久久久.com | 久热中文字幕 | 日韩一区二区三区在线观看视频 | 福利网站导航 | 精品久久电影 | 久久亚洲欧美日韩精品专区 | 小川阿佐美pgd-606在线 | 欧美影院 | 久久99精品久久久久久 | 日韩视频免费看 | 国产综合第一页 | 99久久精品免费看国产四区 | av一区二区三区在线观看 | 尤物在线精品视频 | 亚洲精品9999 | 成人欧美一区二区三区在线播放 | 久久精品影视 | 综合国产第二页 | 亚洲一区二区三 | 日韩中文在线 | 亚洲成人午夜在线 | 久久国内精品 | 国产精品一区二区三区在线 | 国产精品资源在线观看 | 日日噜噜噜夜夜爽爽狠狠视频, | 国产伦精品一区二区三区视频金莲 | 免费成人高清在线视频 | 男人天堂网站 | 久久久久国产精品一区二区 | 中国一级特黄真人毛片 | 日韩av网址在线观看 | 毛片一级片| 成人片免费看 | 女女百合av大片一区二区三区九县 | 欧美日韩精品在线免费观看 |