にサブビューとして追加したUITextView
名前付きのがあります。それ自体がのサブビューです:descriptionText
viewDescription
sliderView
sliderView -> viewDescription -> descriptionText
何らかの理由で、descriptionText
はスクロールしません。ただし、サブビューとしてに追加するとsliderView
、スクロールします...
これが私が作成した方法ですUITextView
:
_descriptionText = [[UITextView alloc] initWithFrame:CGRectMake(10, 30, 220, 100)];
_descriptionText.text = @"Some long text here...";
_descriptionText.backgroundColor = [UIColor clearColor];
_descriptionText.textAlignment = UITextAlignmentLeft;
_descriptionText.textColor = [UIColor whiteColor];
_descriptionText.font = [UIFont boldSystemFontOfSize:11];
_descriptionText.editable = NO;
私が設定したことに注意してください:
_viewDescription.userInteractionEnabled = YES;
どうすればそれを機能させることができますか?
編集1:私もこれらすべてを試しましたが、改善はありませんでした:
[_descriptionText setContentSize:CGSizeMake(500, 500)];
[_descriptionText setContentOffset:CGPointMake(200, 200)];
[_descriptionText setOpaque:TRUE];
[_descriptionText setEditable:NO];
[_descriptionText setShowsVerticalScrollIndicator:YES];
[_descriptionText setScrollEnabled:YES];
[_descriptionText setUserInteractionEnabled:YES];
編集2:これは_viewDescriptionです:
_viewDescription = [[UIView alloc] initWithFrame:CGRectMake( self.frame.size.width + 20, 110, 230, 140)];
これはカスタムsliderViewです:
_sliderView = [[PTSlidersDimension alloc] initWithFrame:CGRectMake(350, 270, 390, 250)]
PTSliderDimensionは、UIViewから継承するカスタムクラスであることに注意してください。