Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot)

I think the problem is that you are testing in simulator. On device, it should work fine. I tested this and it worked. Add an imageview with your splash image when app enters in background – – (void)applicationDidEnterBackground:(UIApplication *)application { UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.bounds]; imageView.tag = 101; // Give some decent tagvalue or … Read more

iOS NSNotificationCenter to check whether the app came from background to foreground

Have you tried UIApplicationWillEnterForegroundNotification? The app also posts a UIApplicationWillEnterForegroundNotification notification shortly before calling applicationWillEnterForeground: to give interested objects a chance to respond to the transition. Subscribe to notification: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(yourUpdateMethodGoesHere:) name:UIApplicationWillEnterForegroundNotification object:nil]; Implement a code, that need to be called: – (void) yourUpdateMethodGoesHere:(NSNotification *) note { // code } Don’t forget to … Read more

moving a function to a background thread in objective c

Well that’s pretty easy actually with GCD. A typical workflow would be something like this: dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul); dispatch_async(queue, ^{ // Perform async operation // Call your method/function here // Example: NSString *result = [anObject calculateSomething]; dispatch_async(dispatch_get_main_queue(), ^{ // Update UI // Example: self.myLabel.text = result; }); }); For more on GCD you … Read more

Difference between background-size:cover and background-size:contain

You can consider looking at the pseudocodes that govern the output. The values allotted to the image’s size depend directly on the aspect ratios of container wrt aspect ratio of the background image. Note: Aspect ratio = width / height Contain if (aspect ratio of container > aspect ratio of image) image-height = container-height image-width … Read more

can we make multi color gradient in xml for android background?

According to developers.android you can… and this is the code they used <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle” > <gradient android:angle=”45″ android:endColor=”#87CEEB” android:centerColor=”#768087″ android:startColor=”#000″ android:type=”linear” /> </shape> also here’s a tutorial hope this helps

background-size contain, but don’t scale up

Unfortunately, what you want to do isn’t possible in CSS. Your best bet is to set the background-size using Javascript. However, if you want the image to scale down if the container is smaller than it, you will have to be able to retrieve the image’s natural height. if ($(‘.el’).height() < imageHeight) { $(‘.el’).css(‘background-size’, ‘contain’); … Read more

Change brightness of background-image?

You can have more layers in the “background” like this: .someObj{ background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)), url(myBgImage.png); } This will put 50% white over the original image making it brighter. Linear-gradient function has to be used, otherwise it doesn’t work. Alternatively use: .someObj:after{ content:”; background:rgba(255,255,255,.5); … } and this is better for code maintainability.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)