不同的對象我想有同一行中一個EditText和按鈕。
那麼爲什麼我把<LinearLayout android:orientation="horizontal"...>
但我也有一個TextView,我不希望該TextView出現在EditText和按鈕相同的行。
感謝您的幫助。如何訂購接口
Q
如何訂購接口
1
A
回答
1
你可以通過很多方式來做到這一點。
- 線性佈局
- 相對佈局
- 表佈局。
使用線性佈局 - 您可以在頂部放置一個線性佈局'A'並將其方向設置爲「垂直」。現在把兩個子節點放在一個新的線性佈局「B」和一個文本視圖中。 在新的線性佈局設置它的方向「水平」,然後在其中添加按鈕,EditText上。
以下是代碼:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:text="EditText"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:width="250dp"></EditText>
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
0
嘗試在你的XML使用RelativeLayout
。
相關問題
- 1. Rails 3查詢接口 - 高級訂購
- 2. 如何訂購
- 3. 如何訂購預購表
- 4. 如何訂購此特定內連接?
- 5. MySQL - 如何訂購連接表?
- 6. 如何訂購UNPIVOT
- 7. 如何訂購HashList?
- 8. 如何訂購DataColumns?
- 9. 如何訂購JSONArray?
- 10. 如何訂購與tslint進口排序規則的進口
- 11. 構造鏈接訂購
- 12. 訂購@ManyToMany連接的ResultList
- 13. 如何訂購,團體,訂單與MySQL
- 14. 如何通過特定訂單訂購?
- 15. 如何訂購此清單?
- 16. 如何「desc」訂購group_by?
- 17. 如何訂購SOLR結果?
- 18. 如何訂購刻面?
- 19. 如何訂購複製
- 20. 如何訂購表格?
- 21. 如何按日期訂購?
- 22. 如何訂購的時間
- 23. 如何在AngularJS中訂購
- 24. 如何訂購空值?
- 25. 如何訂購流合併?
- 26. 如何在XSLT中訂購?
- 27. Linq查詢,如何訂購
- 28. 你如何訂購ggplot
- 29. 如何訂購清單
- 30. scala如何訂購元組?