Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 47

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
02/16/15 04:13 AM (9 years ago)

Menu Image Advanced when rotated (ios)

I'm using this menu, which I really like. The issue I have is that when rotated into landscape, the header image is displayed the same size as for the portrait image. I also use the RD RS pugin (which I also like) and on that, when rotated, the header image stretches to fill the width, which on this app, with my header image, I prefer. I've looked at the code, but not being much of programmer (really not much at all), I can't figure out how it is done. I was wondering if there was an easy fix? Thanks in advance, Alan
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
02/16/15 10:27 PM (9 years ago)
In the Menu with Image, I have an extra set of layout files for the sw600 folder. You have to download the plugin folder to get it. If you drag that folder in, and change the name of the xml file to the same name in the Menu Image Advanced, I wonder if that would fix it? I bet it will, because they are very similar plugins.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/17/15 03:51 AM (9 years ago)
Downloaded the menu, but could not find sw600. Might your answer be for Android? By looking at your code Susan, I did work out a way of detecting Landscape but I don't know if I am on the right track. //Get the height and width, and if we are in landscape, swap width / height values if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){ imageWidth = [appDelegate.rootDevice deviceHeight]; } // end of landscape detection I put this code just above initWithFrame:CGRectMake(0,theTop,imageWidth,imageHeight)]; But it only seemed to fire when the app is started or refreshed in landscape mode, so I am wondering if the plugin doesn't ever try to detect changes from portrait to landscape? Slightly outside my comfort zone.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
02/17/15 07:04 AM (9 years ago)
Sorry, Alan. I thought you meant Android. Do you want the image to stretch to fit, or do you want to show only part of the image?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/17/15 08:06 AM (9 years ago)
I'm looking for the header image to fit to the edges when landscape or portrait. Stretch for Landscape is good, but I am trying to not be too fussy (honest). I've been on thi for a few hours, but I can't figure out how to make the image change or reposition at all on rotation, so any help very gratefully received. I would switch to your menu image if I could, as I think you do this already, but I need the android/IOS detection for backward compatibility.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
02/17/15 08:12 AM (9 years ago)
Actually, I don't have this in the Menu with Image, but that may be a good next feature to add. One thing I have done to alleviate this is to allow you to set a background color for the header. So I have been trying to make header images that blend into the background color as a workaround. Stretching the image rarely works, so it would be better to hide part of the image on rotation. I am traveling today, but I will see if I can see where you could change a setting. I always use the "Fit" in my plugins, so there is no image distortion and the entire image shows. But there are a host of choices.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/17/15 08:20 AM (9 years ago)
Thanks Susan. It works in RD RSS, but sadly, I can't figure out why.
 

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.