[android-developers] Re: Application background image auto resize problem
It sounds like you will want to subclass *Drawable*. Then you implement the *draw(Canvas c)* method in My_Drawable. Then you do *view.setBackground(my_drawable);* Thanks. On Thursday, May 2, 2013 8:43:04 PM UTC-5, Gerson Novais wrote: Hi, I have an application using custom theme in the activity. This theme using android: windowBackground. The problem lies in how the image is displayed. I am setting up gravity to top or center but out instead of the image display only part of the image corresponding to the device screen. The Andorid is resizing the image so that it fits entirely on the screen. How do I transpose the image it leaves the device screen? Any idea? ?xml version=1.0 encoding=utf-8? resources xmlns:android=http://schemas.android.com/apk/res/android; style name=CustomWindowTitleBackground item name=android:background@android:color/transparent/item /style style name=CustomTheme parent=android:Theme item name=android:windowTitleSize48dip/item item name=android:windowTitleBackgroundStyle @style/CustomWindowTitleBackground/item item name=android:windowContentOverlay@null/item item name=android:windowBackground@drawable/bk/item /style/resources Atenciosamente, Gerson Novais -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Application background image auto resize problem
Thats how backgrounds are supposed to work. If you want better control of how the image is displayed, use an ImageView instead. On Friday, May 3, 2013 4:43:04 AM UTC+3, Gerson Novais wrote: Hi, I have an application using custom theme in the activity. This theme using android: windowBackground. The problem lies in how the image is displayed. I am setting up gravity to top or center but out instead of the image display only part of the image corresponding to the device screen. The Andorid is resizing the image so that it fits entirely on the screen. How do I transpose the image it leaves the device screen? Any idea? ?xml version=1.0 encoding=utf-8? resources xmlns:android=http://schemas.android.com/apk/res/android; style name=CustomWindowTitleBackground item name=android:background@android:color/transparent/item /style style name=CustomTheme parent=android:Theme item name=android:windowTitleSize48dip/item item name=android:windowTitleBackgroundStyle @style/CustomWindowTitleBackground/item item name=android:windowContentOverlay@null/item item name=android:windowBackground@drawable/bk/item /style/resources Atenciosamente, Gerson Novais -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.