我有兩個佈局的一個相對佈局的另外一個是線性 佈局......相對佈局是父佈局,而佈局直線是相對佈局的 子佈局。 ......這簡直是我要對齊直線 佈局layout_centerInParent ...它的工作原理XML中,但我想 改變它編程如何改變線性佈局對齊centerInParent編程
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"/>
</LinearLayout>
謝謝你的工作.... – Baadsha
@Baadsha您可以將其標記爲正確的,如果它的工作原理:) – Nabin