我正在爲此工作數小時,無法解決它。 我想合併一個XML文件中的2個圖像 - 所以這將是我的形狀的基本xml文件。 我想要這個形狀包括一個PNG,這是一個框架,而一個PNG是一個框架內的圖片。該圖片將動態變化。android合併2張圖片
我試過使用標籤並構建我的形狀,但是當我將它包含到我的主要xml文件時,它失敗了,因爲我只能以root身份使用合併。 試圖做到這一點,並仍然沒有得到我想要的...
我能做些什麼來合併這兩個PNG,並能夠設置框架內部的PNG位置PNG?
編輯: 一些代碼:
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/userprofilepicture"
android:scaleType="fitXY"
android:contentDescription="@string/SmallLogo" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:contentDescription="@string/SmallLogo"
android:scaleType="fitXY"
android:padding="30dp"
android:src="@drawable/questionmark" />
</FrameLayout>
這是我的框架和內部PIC XML源.. 它的圖形佈局,看起來不錯裏面看時。 當它包含在我的主要XML文件,從somereason它翻轉圖像...?
這是我的主要XML的一部分:
<TableRow>
<ImageView
android:layout_gravity="center_vertical"
android:layout_marginTop="2.5dp"
android:contentDescription="@string/SmallLogo"
android:src="@drawable/logosmall" />
<ImageView
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginTop="2.5dp"
android:contentDescription="@string/slogen"
android:src="@drawable/slogen" />
<include layout="@drawable/userprofilepicture"
android:layout_width="30dp"
android:layout_height="30dp"/>
</TableRow>
我已經將我的代碼添加到我的問題..請看看如果可能 –
好吧,當我不包括,只是複製粘貼framelayout我的main.xml中它的好,謝謝! –