キーボードが表示されたときに、inputAccessoryView 内の UILabel で AutoScrollLabel を使用する方法。IBメソッドを使用してコードに接続していないため、使用に問題があるようです。私はこれをプログラム的に行います。AutoScrollView の .h ファイルをインポートしましたが、エラーが発生します。 ここで AutoScrollLabel を見つけます
これは、inputAccessoryView の私のコードです。
- (void)viewDidLoad
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake
(0, 0, 320, 23)];
label.backgroundColor = [UIColor clearColor];
label.shadowOffset = CGSizeMake(0, 1);
label.text = @"24 Hour time format only!";
label.font = [UIFont systemFontOfSize:17.0];
[label setTextColor:[UIColor whiteColor]];
UIBarButtonItem *text2 = [[UIBarButtonItem alloc] initWithCustomView:label];
UIToolbar* numberToolbar = [[UIToolbar alloc]init];
numberToolbar.barStyle = UIBarStyleBlackOpaque;
numberToolbar.items = [NSArray arrayWithObjects:text2, nil];
[numberToolbar sizeToFit];