[英]How to place start edge of EditText in center horizontal of screen?
我需要並且找不到用於從相對線的水平線中心放置EditText元素的解決方案嗎? 像android:layout_alignParentRight =“ true”一樣,我需要諸如layout_alignParentCenterHorizontal之類的東西。 有那樣的東西嗎? 感謝幫助!
我將創建一個不可見的最小寬度項目,將其水平居中放置,然后相對於此放置我的EditText。 使用INVISIBLE而不是GONE來使可見性屬性起作用。 例如
<TextView
android:id="@+id/centerLine"
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:visibility="invisible"
/>
<EditText
...
android:layout_toRightOf="@id/centerLine"
...
/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.