gpt4 book ai didi

"text"框旁边的Android "Text Field"

转载 作者:行者123 更新时间:2023-11-29 15:29:11 26 4
gpt4 key购买 nike

我是 Android 开发的新手,我有一个愚蠢的问题。如何将“文本字段”框放在一行中的文本旁边。

例子:

Please Enter the number:   [        ] <--- this should be the textfield. 

谢谢。

最佳答案

正如上面其他人所说的那样……您必须将它们放在 LinearLayout 或 RelativeLayout 中。由于您刚刚起步,我建议改用 LinearLayout。这样的事情应该有效。

<LinearLayout android:orientation="horizontal" 
android:layout_height="wrap_content"
android:layout_width="fill_parent">

<TextView android:text="Please Enter The Number:"
android:layout_height="wrap_content"
android:layout_width = "wrap_content"/>

<EditText android:layout_height="wrap_content"
android:layout_width="wrap_content"/>


</LinearLayout>

关于 "text"框旁边的Android "Text Field",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8674393/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com