Tôi có một UIScrollView với phân trang kích hoạt như sau:nội dung UIScrollView không cho phép người dùng tương tác
container = [[UIScrollView alloc] initWithFrame:kScrollViewFrame];
[container setDelegate:self];
[container setShowsHorizontalScrollIndicator:YES];
[container setShowsVerticalScrollIndicator:NO];
[container setClipsToBounds:YES];
[container setPagingEnabled:YES];
[container setDecelerationRate:UIScrollViewDecelerationRateFast];
[container setBounces:NO];
[container setUserInteractionEnabled:NO];
[container setCanCancelContentTouches:NO];
[container setDelaysContentTouches:NO];
Để UIScrollView, tôi thêm vài UIWebViews, và thiết lập sự tương tác của họ kích hoạt để có như vậy.
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
self.frame = frame;
self.userInteractionEnabled = YES;
}
return self;
}
làm hỏng phân trang và tất cả chạm trên UIScrollView. Nếu tôi đặt tương tác người dùng được bật thành KHÔNG, trang hoạt động, nhưng tôi không thể đánh dấu văn bản trong UIWebView. Tôi đã thử subclassing UIScrollView như sau, nhưng các trường hợp tương tự xảy ra. Bất kỳ ý tưởng?
- (id)initWithFrame:(CGRect)frame
{
NSLog(@"init");
return [super initWithFrame:frame];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touchesBegan");
[[self nextResponder] touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touchesMoved");
[[self nextResponder] touchesMoved:touches withEvent:event];
}
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touchesEnded");
[[self nextResponder] touchesEnded:touches withEvent:event];
}
Bạn đang cố gắng đạt được điều gì, bạn có cần cuộn chế độ xem cuộn, cuộn trang web, phân trang, chọn không? Hãy cụ thể hơn. –
Tôi cần chế độ xem cuộn đến trang và người dùng có thể chọn văn bản trên webvies (đó là các bản xem trước của scrollview) Webview không cần phải cuộn, chỉ có thể chọn văn bản của nó. –
Tôi đã chỉnh sửa câu trả lời của mình để phản ánh yêu cầu của bạn, có vẻ như nó đang làm việc cho tôi. –