4
<RelativeLayout
android:id="@+id/widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/my_background"
android:orientation="vertical" >
現在我想使用RemoteViews將此背景更改爲「@ drawable/your_bck」。我想是這樣的如何使用RemoteViews更改小部件背景?
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.yout_bck);
remoteViews.setImageViewBitmap(R.id.widget, bitmap);
但後來我就說明了「Widget加載失敗」
它必須作爲一個背景,因爲我需要設置圖像:)
我明白了,但我需要在此圖像的中心放置一些文字。我想製作一些電池小工具。 :) –
好的,所以把一個TextView集中在ImageView的頂部。 – kabuko
哦,我的上帝,它的工作原理。我正在嘗試這樣做,但我認爲這是不可能的。非常感謝你:)哦,這個可怕的GUI UI編輯器:/ –