サブビュー UILabel を使用して UIScrollView にアクセスする方法を知りたいです。
を使用して UIScrollView にアクセスしようとしました.superview
。しかし、私は今エラーを受け取っています
No visible @interface for 'UIView' declares the selector 'scrollRectToVisible:animated:'
私が使用しているコードは次のようになります
- (void) SymbolButtonPressed:(NSString *)selectedString {
UILabel *label = (UILabel *)[self.view viewWithTag:currentlySelectedTag];
// perform scrolling here, figure out what view your uilable is in.
float newPosition = label.superview.contentOffset.x+label.frame.size.width;
CGRect toVisible = CGRectMake(newPosition, 0, label.superview.frame.size.width, label.superview.frame.size.height);
[label.superview scrollRectToVisible:toVisible animated:YES];
}