除了问题的标题之外,我不知道如何描述问题:我有一个带有标题的按钮,在单击它时会出现,但不是处于正常状态。我四处张望无济于事。
如果您需要查看特定代码或想要其他详细信息(我相信您会这样做),请告诉我。
编辑:按钮是在笔尖中创建的,但这里是设置标题并处理按钮子视图的代码。
[chapterButton setTitle:[NSString stringWithFormat:@"%@: %d",newBookName,newChapter] forState:UIControlStateNormal];
UIImageView *triunghiView = (UIImageView *) [chapterButton viewWithTag:kTagTriangleView];
if(!triunghiView)
{
triunghiView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"triunghi.png"]] autorelease];
[triunghiView setContentMode:UIViewContentModeCenter];
[triunghiView setTag:kTagTriangleView];
[triunghiView sizeToFit];
[chapterButton addSubview:triunghiView];
}
[triunghiView setCenter:CGPointMake(chapterButton.titleLabel.frame.origin.x + chapterButton.titleLabel.frame.size.width + triunghiView.frame.size.width + 5, chapterButton.frame.size.height/2)];