小编Raf*_*dão的帖子

获取UIScrollView的当前位置

我来自Android,我在IOS中遇到了很多麻烦.我需要像电影一样制作滚动菜单.我使用下面的代码:

rol = scroll_view.contentOffset.y;
timer = [NSTimer scheduledTimerWithTimeInterval:.02 target:self selector:@selector(timer_rol) userInfo:nil repeats:YES];

-(void)timer_rol{
    [scroll_view setContentOffset:CGPointMake(0,rol) animated:YES];
rol++;
}
Run Code Online (Sandbox Code Playgroud)

此代码工作正常,但当用户交互向上或向下滚动时,视图返回到之前的位置(rol的值).问题是,如何在滚动后获得当前内容位置

我已经尝试过这些代码,但没有人工作:

CGPoint point = [scroll_view contentOffset];
rol = r.y  +1;

-(void) handleGesture:(UIGestureRecognizer *) sender{}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView {}
Run Code Online (Sandbox Code Playgroud)

有人可以帮帮我吗?

position objective-c uiscrollview ios contentoffset

8
推荐指数
2
解决办法
2万
查看次数

从文本视图上的超链接打开一个对话框 - Android

有一种方法可以在textView上添加某些单词的链接,当我单击该单词时,会打开一个对话框.

例如:TextView - > Word A - Word B - Word C.

当我单击Word A时,显示带有一些选项的对话框,当我单击Word C时,打开另一个带有其他选项的对话框.

我检查了这个链接,但我的问题不合适.

在文本视图中单击时,在浏览器中打开链接之前打开弹出/警报

有人可以帮忙吗?

android dialog hyperlink textview

3
推荐指数
1
解决办法
1693
查看次数