Re: White rectangle behind UIAlertView when subview clipsToBounds
Re: White rectangle behind UIAlertView when subview clipsToBounds
- Subject: Re: White rectangle behind UIAlertView when subview clipsToBounds
- From: Alex Zavatone <email@hidden>
- Date: Thu, 15 May 2014 15:10:54 -0400
It appears as if you're doing this on iOS (even though you didn't mention the platform). In this case, can't you run this through the Simulator and turn on the coloring options under the Debug menu?
On May 15, 2014, at 2:23 PM, Diederik Meijer | Ten Horses wrote:
> Hi David,
>
> Many thanks for your quick response!
>
> UIAlertView is called here:
>
> -(void)welcomeAlert {
> if (![[NSUserDefaults standardUserDefaults] objectForKey:@"welcomeAlertShown"] || [[[NSUserDefaults standardUserDefaults] valueForKey:@"welcomeAlertShown"] isEqual:@"NO"]) {
> UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Welcome to 365 days of Flow!" message:@"\nPlease swipe left or right to browse\n\nTap the screen to find the menu for more options" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
> [av show];
> [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"welcomeAlertShown"];
> [[NSUserDefaults standardUserDefaults] synchronize];
> }
> }
>
>
>
> So indeed, simply by 'show'.
>
>
> View hierarchy is as follows:
>
> ViewController's view
> UIImageView for fullscreen background image (image changes when user scrolls, the UIScrollView below)
> UIImageView for transparent PNG background image (image changes when user scrolls, the UIScrollView below)
> UIView (the centred iPhone5-like view)
> UIScrollView
> 3 UILabels (for the date strings)
> 3 UIImageViews (for the images)
> UIView (separate view with sharing buttons, shown/hidden by button click)
> UIView (Date selector view with UIPickerView, kept offscreen, animates into
>
> Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png
>
> As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, I have no problems with the alert, but then my last UIView (Date selector view) becomes visible, which is something I can't have…
>
> To me it seems the view hierarchy is slightly complex, but not to any kind of extreme.
>
> Many thanks again,
>
> Diederik
>
>
>
>
>
> Op May 15, 2014, om 6:53 PM heeft David Duncan <email@hidden> het volgende geschreven:
>
>>
>> On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses <email@hidden> wrote:
>>
>>> Dear list,
>>>
>>> I implemented a very straightforward UIAlertView.
>>>
>>> For some reason, on iPad, a light rectangular appears behind the alertview, here is what it looks like:
>>>
>>> http://www.tenhorses.com/apps/alertScreenshot.jpg
>>>
>>> What makes it strange is that that light rectangle is not visible when I take a screenshot, see jpg
>>>
>>> This only happens on iPad, not on iPhone.
>>>
>>> The centre part (the white card on the larger background) is a UIView that has a number of subviews.
>>>
>>> This UIView has clipsToBounds set to yes, because I have subviews flying in with animations.
>>>
>>> If I set clipsToBounds to NO, then the alertview is shown normally without any issues.
>>>
>>> Has anybody run into this and is there a way to fix this?
>>
>> When it doesn’t appear in screenshots it usually means its a transient compositing error (as the screenshot re-composites the screen).
>>
>> I’m not certain what exactly would cause this, but you might be served by better describing your view hierarchy (and I assume you are showing your alert with the -show method, and that it is a plain UIAlertView and not a subclass).
>>
>>>
>>> Many thanks,
>>>
>>> Diederik
>>>
>>>
>>> _______________________________________________
>>>
>>> Cocoa-dev mailing list (email@hidden)
>>>
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>> --
>> David Duncan
>>
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden