Discussion Forums  >  Uncategorized

Replies: 6    Views: 382

TriTom50
Android Fan
Profile
Posts: 39
Reg: Aug 20, 2011
tampa
390
10/20/11 08:01 AM (14 years ago)

Header Image Not Scaling in Android 1.5?

On my last two Android 1.5 app projects, the Header Images have not been scaling to fill the Header area in the emulator or in my mobile device. I'm using an image size of 320 x 150... Is there a new recommended size we should be using for the header image in 1.5 that will fill the header area?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/20/11 08:24 AM (14 years ago)
Sort of an ongoing issue. Not sure of the best way to figure this out long term but indivudally the fix is pretty simple (for one app, like yours). FInd the BT_screen_menuList.java file in your source directory. Have a look a the code where it adds the Header Image View to the layout. This is on line 288 or so. You'll see in this section where it sets the 'scale type' for the image. It's set to center. The trouble is that 320 x 150 is a different result in Android and iPhone. This is because Android and iPhone have totally different screen resolutions (resolution is different than actual size). This means the image probably looks very small on the Android device because it's resolution is different than iOS. You can do a few things. You can tinker with the LayoutParams for the Header Image on line 278 and adjust the size of the 'box' the image is in. Or, you can tinker with the scale type of the header image view. Change center to fitStart, fitCenter, fitTop, etc. Have a look at this for some samples: http://etcodehome.blogspot.com/2011/05/android-imageview-scaletype-samples.html
 
TriTom50
Android Fan
Profile
Posts: 39
Reg: Aug 20, 2011
tampa
390
like
10/20/11 09:27 AM (14 years ago)
That's probably not a good idea... Well, at least for me to tinker with the code... ;-| Did perhaps a recent 1.5 update change some value or do something to adversely effect the Header Image code properties? The reason I ask is, because I've already done an app in 1.5 and using the same size Header Image, it looks perfectly fine.
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
10/20/11 12:57 PM (14 years ago)
I have the same issue. It worked fine prior to the last release with all my images. Now no image I use seems good enough.... All of them get the boarder and scale small....
 
TriTom50
Android Fan
Profile
Posts: 39
Reg: Aug 20, 2011
tampa
390
like
10/20/11 02:02 PM (14 years ago)
I guess I'm going back to 1.4 until the bugs get squashed... ;-( Ohhh, it's so hard to go back!
 
TriTom50
Android Fan
Profile
Posts: 39
Reg: Aug 20, 2011
tampa
390
like
10/24/11 12:10 PM (14 years ago)
Greetings David & all BT members. I'd like to give the code change idea a shot, i.e. changing the LayoutParams for the box area, but was hoping you would point me in the right direction with some sample code snippets that would/might do the trick (that would certainly be a treat! excuse the seasonal pun:-) OR..., is there another work-around for this non-scaling header image issue for Android in 1.5? (Seems like more members would be mentioning the funny looking header.) For example, does 1.5 support full screen-shot backgrounds? Maybe that would be a place to start...
 
ALFREA
Aspiring developer
Profile
Posts: 89
Reg: Jul 24, 2011
San Antonio, TX
3,640
like
09/06/12 10:38 PM (13 years ago)
I would like to "tinker with the LayoutParams for the Header Image," but I cannot find the exact place to tinker with it.....is it in the BT_config file in eclipse???? Or, I "can tinker with the scale type of the header image view. Change center to fitStart, fitCenter, fitTop, etc." This seems easier, but I do not know where to find this, either. I feel so close to finishing this 1.5 version.......then I can explore the 2.0 self-hosted.....I just want these header images to work. Please help direct me in the right direction.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.