我是 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>
关于Android "text"位于 "Text Field"框旁边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8674393/