我正在开发一个通用应用程序,其中有一个 UIButton 可以很好地与 iPhone 配合使用,但是当我在 iPad 中单击它时,它需要多次单击尝试才能发生触摸事件。
例如,在点击 5-6 次后,它会执行点击事件。
下面是 UIButton 代码。请帮忙。
UIView *footer = [[[UIView alloc] initWithFrame:(CGRectMake(0, 0, self.tableView.frame.size.width, 54))] autorelease];
float buttonWidth = (int)((self.tableView.frame.size.width - 12 - 12) / 3);
float buttonHeight = 44;
if (clientState.Devicetype == 1) // 1=Ipad
buttonHeight = 90;
cash = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
cash.frame = CGRectMake(6, 10, buttonWidth, buttonHeight);
[cash setTitle:@"Cash" forState:UIControlStateNormal];
[cash setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
[cash addTarget:self action:@selector(handleCash:) forControlEvents:UIControlEventTouchUpInside];
cash.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
if (clientState.Devicetype == 1) // 1=Ipad
{
cash.titleLabel.font = [UIFont systemFontOfSize:28];
}
[footer addSubview:cash];
self.tableView.tableFooterView = footer;