Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 34    Views: 2160

Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
05/16/14 06:47 PM (9 years ago)

White screen before splash screen?

Self Hosted BT 3.0 iOS 5 minimum deployment xcode 5.1.1 Ok, i noticed recently that when my apps launch, i get a white screen for a few seconds while the app load then the splay screen appears. I've also noticed that on Angry Ninjas beautiful Universal Orlando Tour Guide app, there is no white screen before "refreshing data" screen appears. Ninja, how do you do this? Is your "refreshing data" screen a splash screen or something else? Thanks Dave
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/16/14 08:34 PM (9 years ago)
Interesting question for the experts... I had noticed the same behavior and figured it was because I had not added a Launch screen prior to my Splash screen However the default Launch screen in xcode is solid black. ====================== How do you avoid having the screen go solid white during a refresh?
 
Cakebit
Code is Art
Profile
Posts: 500
Reg: Dec 15, 2010
In your local b...
16,500
like
05/16/14 08:55 PM (9 years ago)
I haven't removed the loading screen before, so I can't tell you how to do it... but I do know the loading screen is an XIB called "BT_loadConfigDataViewController.xib". You can easily customize it by working in that file.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/16/14 09:03 PM (9 years ago)
Hey Calypso, I'll have to take a look at my code to find the exact spot, but there is a reference to the background color of that loading screen, by default it's #ffffff (white). Instead of a color, I told it to load an image instead, which is the "refreshing data... Please stand by" screen that you see in my universal studios app. It's not a splash screen, simply an image sized for full screen that loads instead of a solid background color. There's no screen for it in my BT project, it's just a png image that I bundled with the project and call it via code. I'll see if I can find the exact file and line numbers for you tomorrow when I'm in front of my computer. It's a line edit in a .m file, nothing on an xib. The white screen started happening when ios 7 came out
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/16/14 11:12 PM (9 years ago)
Found it... Cakebit was close. It's not the XIB, but the BT_loadConfigDataViewController.m file. In /BT_Layout/BT_loadConfigDataViewController.m, around line 46.... --------------------------- CHANGE: --------------------------- [self.view setBackgroundColor:[UIColor whiteColor]]; --------------------------- TO THIS: --------------------------- [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"YourImageName.png"]]]; Don't forget to include the background image that you referenced in your BT_Images folder in the project. Keep in mind this image will show when the app is initially loading, as well as when the user hits the refresh button if you have one, so best to put some sort of wording on there that lets them know it's loading data. For mine, I used my logo, followed by "Refreshing Data, Please Stand By..." so the user knows something is happening.
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
05/17/14 03:16 AM (9 years ago)
Awesome ! Thanks Angry Ninja. This will make things look much smoother. You're putting out some great work. Thanks again Dave
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/17/14 05:53 AM (9 years ago)
Thanks Ninja! Substituting an image rather then just changing to black is awesome. Your tips on a message to user about refresh is a good idea. Looks like it would display for around 2.5 seconds on my current iPhone and connection speed, so may even be longer in some cases. Now that explains how some apps look like they have three screens on first launch. (because they do) Time for me to get designing a nice Launch Screen-Refresh Screen-Animated logo for Splash Screen... Now I am getting greedy and thinking how to upgrade the little spinner that is displayed during initial and future refreshes. A good example of the effect I would like is the latest Weather Channel app for the iPhone. They display a translucent circle with text and animation during any refresh over the current image.- just started thinking of using the equivalent of animated gif. (will start a new thread) Thanks again for the fix/tip
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/17/14 07:00 AM (9 years ago)
I just tried the change from Ninja and have a question. After replacing the line it does display the image instead of a white screen while the app is refreshing. However when done refreshing, it briefly flashes a white screen prior to displaying my Splash Screen? Wondering if the issue is in BT_screen_splash...
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
05/17/14 08:41 AM (9 years ago)
Thanks for posting this I noticed the same thing a month ago, I never did get to the bottom of things http://www.buzztouch.com/forum/thread.php?tid=23603B7501D4AA7B8E7F9E6&sortColumn=FT.id&sortUpDown=DESC&currentPage=3 I'll give this a try!
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/17/14 08:44 AM (9 years ago)
There is a secondary area that fixes it... I'll put up the code edit shortly... I forgot about that. ;)
 
Cakebit
Code is Art
Profile
Posts: 500
Reg: Dec 15, 2010
In your local b...
16,500
like
05/17/14 08:58 AM (9 years ago)
Remember, because the splashscreen is an XIB, you can customize the XIB - with something like an image view/background image - and it will work perfectly when the splash screen runs.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/17/14 09:17 AM (9 years ago)
In your appname_appdelegate.m, around line 130, I have the following line that uses the same image as my first edit mentioned above: [tmpWindow setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"YourImageName.png"]]];
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
05/17/14 09:32 AM (9 years ago)
WOW! You just helped me charge twice as much for my app. With both of these tweaks, my app launch looks 10 times better. By the way, what's 2 x free = ? Thanks a ton Ninja! I knew that I asked the right person! Dave
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/17/14 09:34 AM (9 years ago)
That price might be a little high... I wouldn't go a penny over free and a half ;) No problem, glad to help. It does make the app look so much better
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/17/14 10:41 AM (9 years ago)
Ninja-Works great. thanks again! Your right that I will need to add the text, but no more flash :)
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/17/14 11:07 AM (9 years ago)
CakeBit- Your idea on customizing with the XIB was cool. I replaced the Gray Activity indicator with a Large White Activity, and also added a two labels (with Alpha settings). Thanks PS- Tried adding the image in the XIB for the first part of the fix BT_loadConfigDataViewController and it also works as advertised :)
 
Jan88
Aspiring developer
Profile
Posts: 9
Reg: May 17, 2014
Bangkok
3,240
like
05/20/14 04:46 AM (9 years ago)
Thanks Angry Ninja. It worked directly! However, does anyone has the same issues that the image is not centralized. It is interestingly in the bottom right corner. I use 640x1136 as the resolution, maybe that is causing problem. Would really appreciate any help! Thank you everyone :)
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/20/14 05:02 AM (9 years ago)
Thats strange, the same dimensions work fine for me. well, actually my screen is exactly half that size, 320x596, and now that I see that, it's making me wonder why I didn't make it x2 from the start... seems like a strong oversight on my part not to make it retina... try a test at 320x596 just for giggles and see if it stays in the bottom right corner. I'm sure it will, but at least I'll know it's just something I missed in my designs and not for some strange intentional reason on my own project. :)
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
05/20/14 05:05 AM (9 years ago)
Retina is not working for me either. I went with 320x 596 and works well on retina screen. It's a little big on the iPhone. 4 screen though. Dave
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
05/22/14 06:13 PM (9 years ago)
See some "different" image sizes being reference in this thread... Why are people using images that are 596h? (or were they typos for 568?) Check out this link: http://www.iosres.com/
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
05/22/14 06:18 PM (9 years ago)
nope, definitely 596, dont know why it fits though
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
05/22/14 06:22 PM (9 years ago)
Yeah, not sure either... It was trial and error on my part that came up with 596 until I had an image that didn't stretch or overlap. Not sure why either, but it worked. I tried 568 at first, but it skewed my image. It's a 28 pixel difference, which isn't a standard size for any nav bar, menu item or iAd banner that I'm aware of, so it's really strange... But it looks good, lol
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
05/30/14 07:37 AM (9 years ago)
will this work only for ios or android also? --------------------------- CHANGE: --------------------------- [self.view setBackgroundColor:[UIColor whiteColor]]; --------------------------- TO THIS: --------------------------- [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"YourImageName.png"]]];
 
Skywalker
Apple Fan
Profile
Posts: 117
Reg: Dec 25, 2013
上海
1,670
like
06/02/14 12:29 AM (9 years ago)
Why I didn't get the expected result although I have done the two code replace jobs said by Angry Ninja. My App change to launch black screen instead of white screen. I have checked the code and the image I put in the BT-image folder, it all OK, as the following pis shows: https://www.dropbox.com/s/59x9uycvr86xk08/launchwhitescreen.jpg Another problem is that how many sizes pictures should I prepared for the loading screen? Still need to prepare to all kinds of images like the launch images? Thanks for anyone who can help....
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
06/02/14 12:38 AM (9 years ago)
See my reply in the other duplicate message you posted
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
06/02/14 02:23 AM (9 years ago)
Thanks for this solution @Angry Ninja, works great! Farcat
 
Skywalker
Apple Fan
Profile
Posts: 117
Reg: Dec 25, 2013
上海
1,670
like
06/03/14 01:21 AM (9 years ago)
hi, Angry Ninja I have change the code as you mentioned, the white screen is gone, replaced by my own image, that's really nice... but there is a new problem....my app can be full screen in iphone5 (see dropbox photo), it still run with iphone4 size..., it used to be full screen. will those code change cause this phenomenon? https://www.dropbox.com/s/xrf5xa889ajjvp6/Notfullscreen.jpg
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
06/03/14 01:30 AM (9 years ago)
Hi@ Skywalker, I think that with this method one graphic must fit all. Same thing with iPad, it tiles the graphic instead of opening full page. What we would need is a condition of some type (if iPad open "ipad.png", if iphone4 open "iphone4.png"), I am no coder but the solution is probably out there, I'll Google the heck out of it and will post if I find a solution. Cheers, Farcat
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/06/14 12:36 PM (9 years ago)
What is the procedure for Android?
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/26/14 02:08 AM (9 years ago)
this is great, my App has 4336 screens, so the refresh at the start is around 17 secs, bit long, i know to speed this up, i need to host child items on either buzz or my url, but doing that on the amount of screens would add another few weeks to my project which i cant do right now, this enables me to have a screen explaining that its refreshing all its data, wierd little problem im having on ios version, is the splash screen has suddenly starting show small on ipad with black surround, i have the screen png packaged with the project, and i have played around with the settings, ie middle , left, full screen and nothing wotks :)
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
06/26/14 07:09 AM (9 years ago)
@funkyMonkey -- the original size of the screen png matters. Be sure to make it be the size of the iPad (landscape or portrait). -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/26/14 07:18 AM (9 years ago)
thanks niraj, will check that out, it only just started doing it though, but will recheck the sizes. thanks sean
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
06/26/14 09:08 AM (9 years ago)
Niraj, I just did this change this morning for the Universal app I have for my school district. The screen size thing is weird. I have noticed the same issue with splash screens. Here is what I have found: 1. 1536x2048 is too big for iPad and iPad with Retina 2. 768X1024 works for both iPad and iPad with Retina, but on iPhone only upper right hand corner of png is visible. I was thinking that the BT splash screen can handle multiple screen sizes for Universal apps so I re-appropriated that code for this. I will post the code I used in a couple of minutes. It is on my other Mac.
 
bfoutty
Code is Art
Profile
Posts: 185
Reg: Jun 12, 2011
Youngstown, OH
12,650
like
06/26/14 09:17 AM (9 years ago)
Here is the code I used to make the loading screens work for both iPad and iPhone: In /BT_Layout/BT_loadConfigDataViewController.m, around line 46.... --------------------------- ADD: --------------------------- //appDelegate appname_appDelegate *appDelegate = (appname_appDelegate *)[[UIApplication sharedApplication] delegate]; AND THEN --------------------------- CHANGE: --------------------------- [self.view setBackgroundColor:[UIColor whiteColor]]; --------------------------- TO THIS: --------------------------- [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"yourImageNameSmall.png"]]]; if([appDelegate.rootDevice isIPad]){ [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"yourImageNameLarge.png"]]]; AND THEN In your appname_appdelegate.m, around line 130 [tmpWindow setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"yourImageNameSmall.png"]]]; [self setWindow:tmpWindow]; if([rootDevice isIPad]){ UIWindow *tmpWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [tmpWindow setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"yourImageNameLarge.png"]]]; [self setWindow:tmpWindow]; } I used screen size 768x1024 for the Large image and 320 x 596 for Small image. I tested this and works well for me even with a splash screen loading after.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/26/14 09:29 AM (9 years ago)
thanks dude, thats great advice, will implement it now :)
 

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.