Strange Bug in iPhone SDK
I found a strange bug in iphone sdk. I try to explain it:
I have a number of uibuttons in a view. They are all just images. Every buttons has a title but that is not displayed so you just see the images (all 80x80). I made it all in IB. In my code I position those buttons. Here's a snippet of that code:
for(NSString *iconObject in iconArray){
//retrieve UIButtons from dictionary
iconButton = [allIconsDictionary objectForKey:iconObject];
iconButton.hidden = NO;
//po开发者_JAVA技巧sition and resize icon Buttons
iconButton.frame = CGRectMake((79 * col) + 28, (70 * row) + 70, 80 ,80);
col++;
//five buttons in a row
if(col%5 == 0){
row++;
col = 0;
}
}
That works like it should. But for all buttons that title starts with a 't' the title displays in the simulator (also on the device). The title of the other buttons are not shown just those where the title starts with a 't'. I have no clue what this could be?!
I hope I could describe the problem.
I'm confused - you say they all have an image and a title that's not displayed - why bother with a title at all then?
I'm guessing that your your images aren't all the same size.
Some buttons are big enough to get the image and the first letter of the title in them. The other buttons have images the correct size so the title isn't displayed.
精彩评论