uiscrollview

Autoscrolling the UIscrollview [duplicate]

狂风中的少年 提交于 2019-12-11 16:34:09
问题 This question already has answers here : Autoscrolling in a UIScrollview (3 answers) Closed 5 years ago . I have already asked the same question a few time but I have had no answer. I would like to know if someone can help me get a UIScrollview to autoscroll down the page with an incrementally faster speeds . I also have buttons on the page. It would also be great when the user touches a button on the page it keeps autoscrolling. So if you kind of understand it will be like the game Piano

UITextField is partially hidden by Keyboard when opened

好久不见. 提交于 2019-12-11 16:09:21
问题 I am attempting to create a collection of UITextField elements. I'd like the next button on the keyboard to skip to the next field and if that field is hidden from view by the keyboard, scroll it into view. This is my attempt. It works apart from 1 aspect. When dismissing the keyboard and then selecting another (or the same) field, the text input is partially hidden by the keyboard (see attached gif). The meat and potatoes is within the ViewController extension. class ViewController:

OPENGL/ES 3D model zoomed doesn't pan correctly in UIScrollView

两盒软妹~` 提交于 2019-12-11 15:59:54
问题 I have a 3d model rendered in a UIView. When I pinch the model it zooms correctly, but when zoomed in I'd like the ability to pan/scroll the view so that I can see the parts of the model which are outside the boundaries of the view. I switched the UIView to a UIScrollView, and on the pinch event is update the content size with the scale factor. This works great and I can now scroll the view. My problem is that panning to the outer edges of the content view still shows the 3d model still

Why does UIScrollView cancel my touches on the iPad, but not on the iPhone? [closed]

风流意气都作罢 提交于 2019-12-11 15:48:59
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I have an UIScrollView subclass where I implement all of those 4 touch event handling methods like -touchesBegan:withEvent: , etc. On the iPhone, the

How to make full screen background image inside ScrollView and keep aspect ratio

☆樱花仙子☆ 提交于 2019-12-11 15:16:34
问题 I have a background image @2x 7360x828px and @3x 11040x1242px used inside ScrollView, looks nice on all iPhones (full screen), but on iPad background image takes only half of the screen height. I have tried many variations, with auto layout and without, with different contentMode, but I can't achieve my goal, either background image is very stretched, or image with correct aspect ratio is smaller than ScrollView. My last code: var imageView = UIImageView(image: UIImage(named: "map.png")) lazy

iOS Swift : ScrollView strict dragging

﹥>﹥吖頭↗ 提交于 2019-12-11 15:13:25
问题 I have a scrollView(only horizontal scrolling) in which two collection views and want that if it is dragged/Swiped upto >= mid of screen then it should scroll forward i.e right side (show 2nd collection view) else it should be in left side(show first collection view). It should not stay half scrolled either full or none. How can i make this possible? 回答1: To achieve a scroll snap, you want to use this UIScrollViewDelegate method: func scrollViewWillEndDragging(_ scrollView: UIScrollView,

How can I determine the area currently visible in a scrollview and determine the center?

与世无争的帅哥 提交于 2019-12-11 14:39:08
问题 I have a map app where the user can place waypoints manually. I would like for them to press the waypoint button and have a waypoint placed in the center of their currently visible view on the content view. 回答1: I'm afraid you'd have to calculate it yourself. contentSize returns size of the scrolled content, contentOffset gives you the origin of the scroll view inside the content. Then with scrollView.bounds.size you can find the center of the view. Haven't tested this, but maybe you could

iOS : How to do proper paging in UIScrollView?

我的未来我决定 提交于 2019-12-11 14:11:57
问题 I've a UIScrollView of size (320,160). I'm adding some UIImageView into it, which are of size (213,160). The first UImageView starting from 54 (x) and so on, I've added a space of 5.0 in between each UIImageView . I've also enabled pagingEnable in IB & in coding . What my problem is its not properly working as per its property! When I scroll it should show me UIImageViews in each single page instead it showing me something like see screenshot I want output something like this see output

Adding view above origin of UIScrollView iOS

↘锁芯ラ 提交于 2019-12-11 13:53:54
问题 I am trying to add UIViews above its origin. For example Suppose i have added subview A at origin (x= 0 , y = 0); now i want to add another subview B above this subview so i tried UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -500, 200, 500)]; view.backgroundColor = [UIColor redColor]; [scrollView addSubview:view]; [scrollView setContentOffset:CGPointMake(0, 500)]; [scrollView setContentSize:CGSizeMake(300, scrollView.frame.size.height+500)]; I want to add many views like this

UITapGestureRecognizer only triggered for starting area of UIScrollView

那年仲夏 提交于 2019-12-11 13:46:41
问题 I have several sub views added to a UIScrollView in the main view controller. Each sub view's view controller has its own tap recognizer. The problem is, only tapping in the starting area on the screen is recognised. After scrolling the view and tapping beyond the starting area, the tapping handler will no longer be called. This SO post UIButton in non-visible area of UIScrollView seems to be relevant but its solution description wasn't really clear to me... A simple report project could be