2013年8月15日 星期四

圖片處理


drawable-ldpi      :  120 dpi
drawable-mdpi    :  160 dpi
drawable-hdpi     :  240 dpi
drawable-xhdpi   :  320 dpi


drawable-xxhdpi :  480 dpi



加入圖片到資料夾下後,將自動產生圖片的resource ID



從XML設定圖片

ex:


 <Button
    android:id="@+id/next_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/next_button"
     android:drawableRight="@drawable/arrow_right"
    android:drawablePadding="4dp" />



To adjust for the different device screen densities, we need to follow a 3:4:6:8 scaling ratio between the four density sizes. (For the iPhone, it’s easy: it’s just a 2:1 ratio between the iPhone 4 and 3GS.) Using our ratios and some simple math, we can create four different versions of our bitmap to hand off to our developer for production:
75 × 75 for low-density screens (i.e. ×0.75);
100 × 100 for medium-density screens (our baseline);
150 × 150 for high-density screens (×1.5);
200 × 200 for extra high-density screens (×2.0). (We’re concerned with only lDPI, mDPI and hDPI for Android smartphone apps.)

reference:

http://mobile.smashingmagazine.com/2011/06/30/designing-for-android/

http://developer.android.com/design/style/iconography.html




沒有留言:

張貼留言