Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 53

Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
01/13/14 09:12 PM (11 years ago)

BT Quiz iOS 7 Button Error

Hi All, I am using BT3.0, and am having the following problem: http://jakeserver.com/Uploads/Buzztouch/Quiz-Button-Display-Error_iOS7.png I have a feeling this has to do with the button being a default round rectangle. In iOS 7, they must have made it transparent with no border. Does anybody know of a fix? Jake
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/14 09:19 PM (11 years ago)
Oh yeah. Annoying. You can always use a 'custom' button, and define a 'button image' for it. I got the same thing in my SmugEula… haven't bothered to fix it, but that was my 'plan' when I did… Cheers! -- Smug
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/13/14 11:00 PM (11 years ago)
So here are the details of the button: 1. The name of the object is "startButton" 2. The type of the button is "UIButtonTypeRoundedRect" which is deprecated. This should be changed to "UIButtonTypeSystem" 3. Adding the following adds a white color to the button: startButton.backgroundColor = [UIColor whiteColor]; 4. Adding the following adds a border to the button: startButton.layer.borderColor = [UIColor lightGrayColor].CGColor; startButton.layer.borderWidth = 0.5f; 5. Adding the following adds a radius to the button: startButton.layer.cornerRadius = 10.0f; All modified code (to be placed in BT_screen_quiz.m): //create rounded rectangle start button startButton = [UIButton buttonWithType:UIButtonTypeSystem]; [startButton setFrame:CGRectMake(margin, answerButtonBoxTop + 5, answerButtonBoxWidth, buttonHeight)]; startButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; startButton.backgroundColor = [UIColor whiteColor]; startButton.layer.borderColor = [UIColor lightGrayColor].CGColor; startButton.layer.borderWidth = 0.5f; startButton.layer.cornerRadius = 10.0f; [startButton addTarget:self action:@selector(startQuiz) forControlEvents:UIControlEventTouchUpInside]; [startButton.titleLabel setFont:[UIFont boldSystemFontOfSize:30]]; [startButton setTitle:NSLocalizedString(@"quizStart",@"start quiz") forState:UIControlStateNormal]; What do you think? These options should restore the old button functionality. Jake
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/13/14 11:36 PM (11 years ago)
It looks like it should cover the bases. If it works for you, then it sounds like a great solution. I'll do some playing around with the code when I get back to working on the Eula plugin again… Cheers! -- Smug
 

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.