アプリの開発中に奇妙なことが起こりました。いくつかの UIButtons を含むビューがあります。すべてがカスタム アートワークを使用しており、CostumType の UIButton です。私にとっては、すべてが正しいと感じました。シミュレーターと電話で。
しかし、アプリを他の人に渡すと、その人がボタンをタップしても機能しません。ボタンは特定のタップに対する反応のように感じますが、実際には正しくありません (通常の動作と比較すると)。
正常に動作させるにはどうすればよいですか?通常とは、iOS アプリに慣れている人が、機能すること以外は同じように使用できることを意味します。
ボタンのコード例を次に示します。
focusButton = [UIButton buttonWithType:UIButtonTypeCustom];
[focusButton setFrame:CGRectMake(self.bounds.size.width-(self.bounds.size.width/widthFactor)+108, self.bounds.origin.y+(self.bounds.size.height/(heightFactor*2))+2, 36, 40)];
focusButton.contentHorizontalAlignment = false; // I think these lines doesn't effect the behavior
focusButton.contentVerticalAlignment = false;
[focusButton setBackgroundImage:[UIImage imageNamed:@"arrowUp.png"] forState:UIControlStateNormal];
[focusButton setBackgroundImage:[UIImage imageNamed:@"arrowUpH.png"] forState:UIControlStateHighlighted];
[focusButton addTarget:self action:@selector(focusOrDefocusCourse) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:focusButton];
ボタンの背景は次のようになります。