我試圖在線性佈局內水平放置視圖,這樣我可以水平對齊這些視圖,但不能彼此相鄰。我試圖給邊際,填充值等,但沒有爲我工作。所有的意見都保持在一起。無法在線性佈局中水平對齊視圖
我希望數字時鐘位於最右側,WiFi圖像位於中央。 請建議我應該使用什麼來使用最小硬代碼將視圖與分隔對齊。
<LinearLayout
android:id="@+id/top_bar_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/top_bar"
android:orientation="horizontal" >
<ImageView
android:id="@+id/signal_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/signal1" />
<ImageView
android:id="@+id/nosim_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/wifi_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/wifi1" />
<ImageView
android:id="@+id/battery_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/battery1"
/>
<DigitalClock
android:id="@+id/digClock_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
謝謝..相對佈局工作 –
很高興幫助:) – Gio