Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 71

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
03/11/14 11:17 AM (10 years ago)

Quiz IOS 7

Using the quiz plugin, when you start, you need to click on a 'start quiz' button. In IOS 6 this is black text on a white button. On IOS 7 the text shows up as black without a white button. I'd like to change this so the effect is ok for both IOS 6 or 7. I'm going with an overall dark background colors to mask a wierd shadow effect on the answer button backgrounds, but that is another story. I can't code, but if somebody could suggest what to paste in and where, I'll give it a go! It feels like a one-liner to change a color somewhere (I'm hoping) Thanks in advance, Alan
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/11/14 11:49 AM (10 years ago)
in the BT_screen_quiz.m file, just after line 204 (where it starts building the "Go button" you can add a line like this... [startButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; and change the "blackColor" to any of the built in colors. Or you can use BT's built in UIColor method to create a custom color from RGB. You can also get fancy and add a if-then statement to change the color depending on IOS version. This syntax might not be exact, but it should be close.... ver = [[[UIDevice currentDevice] systemVersion] floatValue]; if (ver >= 7.0) { [startButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; } else { [startButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; } Hope this is close to what you are looking for. -Chris
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/11/14 12:37 PM (10 years ago)
Cheers Chris, I'll give it a go in the morning. Any idea why the button doesn't show in IOS 7?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/11/14 12:45 PM (10 years ago)
It's there, but its just the wrong text color for the default background.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
03/11/14 12:47 PM (10 years ago)
Also, now that I think about it.... that if-then snippet above comes from the quiz plugin, so depending on where you put it, you may not need the first line (assigning the variable "ver").
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/12/14 09:49 AM (10 years ago)
Thank you for this Chris, It worked!. I ended up setting the background colour to white and the text to black, without using any conditional statements. I think the real issue is a small bug in the plugin code, something to do with transparency differences for IOS 6 & 7 I suspect. Being pleased with myself, I started to try and find out why the navbar text is black on IOS 7 and white on IOS 6. I started staring at the code (looking implies some degree of competence) and I saw an area where the string the plugin looks for is 'transparency' and the string in the control panel for color setting is 'clear'. I think that is for the navbar, but I started to break things and decide to quit while I was ahead!
 

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.