在此佈局中,我想將「語言」的位置更改爲右... 我使用佈局重力和重力沒有任何成功,任何人都知道如何以最少的更改進行操作?將LinearLayout更改爲從左到右
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_padding_small"
android:orientation="horizontal" >
<com.pt.chfnt.view.widget.OpenSansRegularTextView
android:layout_width="@dimen/lblSignupHeaderWidth"
android:layout_height="wrap_content"
android:textColor="@color/primary_text"
android:textSize="@dimen/text_size_normal"
android:layout_marginLeft="@dimen/margin_padding_xxtiny"
android:gravity="center_vertical"
android:text="ایمیل:" />
<com.pt.chfnt.view.widget.OpenSansRegularTextView
android:id="@+id/lblEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="@dimen/text_size_xnormal"
android:paddingTop="@dimen/margin_padding_small"
android:paddingBottom="@dimen/margin_padding_small"
android:layout_marginLeft="@dimen/margin_padding_xxnormal"
android:layout_marginRight="@dimen/margin_padding_small"
android:gravity="center_vertical"
android:background="@drawable/layout_register"
android:inputType="textEmailAddress" />
</LinearLayout>
設置TextView的寬度,以填補行,然後設置重力 –
使用相對佈局而不是和的LinearLayout保持該TextView的單獨的LinearLayout,你可以改變的然後它的位置。 – AndroidHacker
混淆:'將LinearLayout更改爲從左到右'以及'將「的位置更改爲」右側「是兩個不同的事情。 。 LinearLayout也是水平的,這可能意味着額外的東西 。這是一個奇蹟,爲什麼現在有三種不同的意見。 – CmosBattery