0
A
回答
0
事情是这样的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Apellidos"/>
<EditText
android:id="@+id/editText"
android:layout_toRightOf="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hind="Apellidos"/>
<LinearLayout
android:layout_below="@+id/editText"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_weight="1"
android:layout_marginRight="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Ciudad"/>
<EditText
android:layout_toRightOf="@+id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hind="Apellidos"/>
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Ciudad"/>
<EditText
android:layout_toRightOf="@+id/text3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hind="Apellidos"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
编辑:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/name"
android:orientation="vertical"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/text"
android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Apellidos"/>
<TextView
android:id="@+id/text1"
android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Apelli"/>
</LinearLayout>
<LinearLayout
android:id="@+id/value"
android:orientation="vertical"
android:layout_toRightOf="@+id/name"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/text"
android:hind="Apellidos" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_weight="2"
android:layout_toRightOf="@+id/text2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:hind="Apellidos"/>
<TextView
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:id="@+id/text2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Ciudad"/>
<EditText
android:layout_weight="2"
android:layout_toRightOf="@+id/text2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hind="xyz"/>
</LinearLayout>
</LinearLayout>
+0
这就是想法,但组件并不对齐 –
+0
你的意思是左侧textview没有被分配?如果是的话,你必须添加空格到文本,并使他们都是相同的长度 – khetanrajesh
+0
你是对的。我已经尝试过它,但它工作,但我担心当国际化发生 –
1
虽然你可以使用RelativeLayout的实现这一点,它是使用ConstraintLayout的理想人选,这将让您指定元素位置相对于彼此以及在窗口在平板电脑或多窗口模式下调整大小时应如何扩展/重新定位。
相关问题
- 1. 如何在此表单中制作reCaptcha?
- 2. 在android studio上制作表格
- 3. 如何制作此边框
- 4. 如何在Android上进行此布局?
- 5. 如何在JDialog上制作表格
- 6. 如何制作单个实例表单
- 7. 如何在Flash中制作此动画
- 8. 如何在CSS中制作此形状?
- 9. 如何在graphviz中制作此图?
- 10. 如何在html中制作此形状?
- 11. 如何在unity3d中制作具有此效果的菜单?
- 12. 如何在Swing中绘制此图表?
- 13. 如何在此上使用简单的操作符?
- 14. jQuery制作表单消失并出现在彼此之后
- 15. 制作特定表单在多个表单上不可见
- 16. 如何让此DialogBox在列表项上单击弹出?
- 17. 如何在此数据上创建表?
- 18. 如何在Android的材料设计列表上制作圆形列表图标?
- 19. 如何为此Android项目制作自定义xml布局?
- 20. 我该如何制作此自定义控件和Android
- 21. 如何制作此图片中显示的Android活动?
- 22. j2me表单(在Android上)
- 23. 如何制作表单字段?
- 24. 如何制作密码更改表单?
- 25. 如何制作灰色的HTML表单?
- 26. 如何在页面上制作单独的菜单?
- 27. 如何将此div放置在此搜索表单下方?
- 28. 在表单上绘制点
- 29. 如何仅使用ul,li和css来制作此菜单?
- 30. 如何使用HTML和CSS制作此菜单
你应该发布你迄今为止所做的。帮助更容易。 – davidxxx
对不起! Stackoverflow说我至少需要10分才能上传图片。我目前是6. –