Is there a way to get a link to the button frames in the generated alertView? I would like to find the position of the top button so that I can use its frame to position the image directly above it. I have a couple extra \ n at the end of my alertview message to make sure there is space for the image, but I need to determine where this free space is in alertview mode. Using the top button as a link seems like a reliable way to find it.
I tried the following, which returns an array of buttons (ThreePartButton ??), but if the size of each button is set, then for x of them they are 0.
NSArray *buttonArray = [alertView valueForKey:@"_buttons"];
for (UIControl *aControl in buttonArray)
{
CGRect rect = aControl.frame;
NSLog(@"x:%2.2f y:%2.2f w:%2.2f h:%2.2f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
}
Any suggestions for a working solution would be highly appreciated!
source
share