[英]Icon for menu selection/android
我正在創建一個LinearLayout並在此布局中...將有一個選擇菜單。 我想知道如何在文本旁邊添加一個圖標。 這是我的以下代碼:
<ImageView
android:src="@drawable/ic_launcher"
android:layout_width="200dp"
android:layout_height="175dp"
android:layout_gravity="left"
<TextView
android:text="Check Account"
android:textSize="20dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_gravity="right"/>
</ImageView>
它不按我想要的方式工作。
請幫忙。
我不知道“選擇菜單”是什么意思,但是如果你想讓這個文字+圖像成為可以點擊的選項,你可能想要使用普通按鈕 。
您可以在此文本的頂部/底部/右側/左側添加文本和繪圖,一起形成一個按鈕。
<Button
android:id="@+id/groups_button_bg"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="MenuOption1"
android:drawableTop="@drawable/[image]" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.