Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何以编程方式创建滚动视图_Ios_Objective C - Fatal编程技术网

Ios 如何以编程方式创建滚动视图

Ios 如何以编程方式创建滚动视图,ios,objective-c,Ios,Objective C,如何在Xcode中单击按钮时创建简单的滚动视图 我已经指定了按钮,按下时给出了I操作, 要编写什么代码来对此操作进行滚动查看 -(IBAction)press { } 在.h文件中,必须将委托定义添加到类声明中-类似于以下内容: @interface someClass : NSObject <UIScrollViewDelegate> -(IBAction)press { UIScrollView *_scrollView = [[UIScrollView

如何在Xcode中单击按钮时创建简单的滚动视图

我已经指定了按钮,按下时给出了
I操作
, 要编写什么代码来对此操作进行滚动查看

 -(IBAction)press
 {

 }

.h
文件中,必须将委托定义添加到类声明中-类似于以下内容:

@interface someClass : NSObject <UIScrollViewDelegate>
 -(IBAction)press
 {
    UIScrollView *_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
    _scrollView.backgroundColor = [UIColor clearColor];
    _scrollView.userInteractionEnabled = YES;
    _scrollView.delegate = nil;

    [self.view addSubview:self.scrollView];
}
就这些!:)

可能的重复可能的重复可能的重复可能的重复可能的重复