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

編輯文本標(biāo)簽?

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

問題描述

限時(shí)送ChatGPT賬號(hào)..

我想要一些像這樣的布局

I want to have some layout a bit like this

[text tabel][edittext]

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

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

[TextView][EditText]

但我不能讓他們?cè)谕恍羞@是我的 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" /> 

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

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

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

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>

這篇關(guān)于編輯文本標(biāo)簽?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Cut, copy, paste in android(在android中剪切、復(fù)制、粘貼)
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 位小數(shù)的數(shù)字)
Changing where cursor starts in an expanded EditText(更改光標(biāo)在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 国产亚洲区 | 成人在线中文 | 97精品国产97久久久久久免费 | 三级av在线 | 亚洲一区二区三区在线播放 | 亚洲精品一区二区久 | 久久亚洲美女 | 超碰8| 精品久久久久久久久久久久 | 欧美成人黄色小说 | 亚洲国产精品久久久久婷婷老年 | 亚洲一区中文字幕 | 91av在线电影| 国产精品免费在线 | 免费成人在线网站 | 91私密视频 | 成人高清视频在线观看 | 二区亚洲| 超碰婷婷| 欧美最猛性xxxxx亚洲精品 | 中文字幕成人 | av一区二区三区四区 | 天天射天天操天天干 | www.99热.com | 国产午夜精品一区二区三区嫩草 | 久久久久久久av | 插插宗合网 | 亚洲精品一区二区三区丝袜 | 国产精品久久久久久婷婷天堂 | 久久久久久久久久久91 | 国产真实精品久久二三区 | 天天综合国产 | 欧美一区二区三区国产 | 国产伦精品一区二区三区高清 | 精品国产乱码久久久久久图片 | 中文字幕1区2区 | 欧美区在线 | 亚洲综合天堂网 | 欧美日韩综合一区 | 国产精品视频一区二区三区不卡 | 国产美女久久 |