在我的項目中,我有一個菜單。對於我想要使用gridView的菜單設計。爲簡單起見,假定此網格視圖只有一個項目。這個項目有兩個獨立的圖像(background.png和news.png)和一個文本(例如「NEWS」)。Android,如何將圖片放在另一張圖片上?
是否可以通過xml或代碼將background.png上的news.png映射到background.png上?
感謝您的幫助。
在我的項目中,我有一個菜單。對於我想要使用gridView的菜單設計。爲簡單起見,假定此網格視圖只有一個項目。這個項目有兩個獨立的圖像(background.png和news.png)和一個文本(例如「NEWS」)。Android,如何將圖片放在另一張圖片上?
是否可以通過xml或代碼將background.png上的news.png映射到background.png上?
感謝您的幫助。
是的你可以隨時使用FrameLayout在xml文件中,像這樣。
<FrameLayout android:id="@+id/frameLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/imageView1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/background"></ImageView>
<ImageView android:id="@+id/imageView2" android:layout_width="wrap_content"
android:layout_gravity="center" android:layout_height="wrap_content"
android:src="@drawable/news"></ImageView>
<TextView android:text="NEWS" android:id="@+id/textView1" android:layout_gravity="bottom|center_horizontal"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</FrameLayout>
你想顯示兩個圖像在另一個... – 2012-02-29 05:11:51
是的,我想知道它是否實用? – Hesam 2012-02-29 05:46:25
@Hesam你有沒有找到任何解決方案> – PriyankaChauhan 2016-11-02 10:29:14