4
由於錯誤日誌建議使用drawable-*
來提供密度優化的圖像,所以我將/drawable
的9個補丁文件移動到/drawable-hdpi
。當從/ drawable-hdpi而不是/ drawable加載爲背景時,Drawable的大小不同/可繪製
問題是,AppWidget
現在看起來不同。當Drawables
存儲在/drawable-hdpi
邊框更厚。
欲瞭解更多信息,比較所附的截圖。這種差異的原因是什麼?
截圖
佈局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/widget_bg" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/widget_loading"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="4dp"
android:layout_toLeftOf="@+id/textView1" />
</RelativeLayout>
繪製對象@drawable/widget_bg_default
widget_bg(存儲在/drawables
)
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/widget_bg_default" android:state_focused="false" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/widget_bg_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_launcher" android:state_selected="true"/>
<item android:drawable="@drawable/widget_bg_focused" android:state_focused="true"/>
</selector>
您的鏈接已死亡。 – 2013-03-16 17:40:48
@SargeBorsch是的,我想他們刪除它。 – Mayank 2013-03-16 18:29:59
也許這將有助於http://developer.android.com/guide/practices/screens_support.html – Mayank 2013-03-16 18:31:09