uiscrollview

Defining scroll amount with UIScrollView and PageControl

送分小仙女□ 提交于 2019-12-24 19:00:17
问题 For the application I am working on I need a scrollview with paging along with a number of views (in this case tableviews). Setting this up (using Apple's PageControl example) is easy enough and I have no problem making it work in regards to scrolling and snapping between pages. I want the tableviews to be almost like thumbnail representations of the tableviews in the scrollview. Once you click one it opens or zooms in to let the tableview cover the entire screen. Again, setting this up is

How do I get my UIView to redraw while the user is scrolling a UIScrollView?

自作多情 提交于 2019-12-24 17:29:56
问题 I have a root UIView with two subviews: a custom UIView subclass a UIScrollView The custom UIView subclass has some state that is updated by an NSTimer that fires every N seconds. When the view's state is updated, the view calls [self setNeedsDisplay], which triggers a redraw shortly thereafter. This all works as expected. However, whenever the user scrolls the UIScrollView, the custom UIView subclass does not redraw. The moment the user touches the UIScrollView, the redraws stop happening.

Change scrolling position of collection view, when view is currently not visible

时光总嘲笑我的痴心妄想 提交于 2019-12-24 16:42:32
问题 There are two scenarios where I have problem with setting the scrolling position of my collection view: on start up I want to scroll to a certain item (starting position != beginning of the collection view) view is currently not visible yet, but in "background" the collection view should scroll to a certain item What is a reliable way to scroll the collection view to a certain cell? Currently I'm setting the scrolling position with scrollToItemAtIndexPath in viewDidAppear , but that is too

Adding constraints programmatically in UIScrollView with dynamic buttons - Swift

北战南征 提交于 2019-12-24 16:29:49
问题 I'm trying to add constraints programmatically in my ScrollView but not working. The problem is it does not work the leading and Trailing for my label and buttons. I want to put on a scroll view first one label and below the label eg 10 dynamic buttons. The code is: var buttons : [UIButton] = [] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. //Create controller and get view //var controller = UIViewController() var

Stopping ScrollView Going Above & Below The Bounds

人盡茶涼 提交于 2019-12-24 14:28:42
问题 I created a UIScrollView in a ViewController and added UIView & UITableView as siblings of ViewController. var pageSize = view.bounds.size // MiniQuestion: I disabled vertical indicators but it caused a gap for the width // of the indicator, so I added the gap manually. Is it okay behaviour? pageSize.width += 5 MyView.backgroundColor = UIColor.redColor() MyTableView.backgroundColor = UIColor.blueColor() let pagesViews = [MyView , MyTableView] let numberOfPages = pagesViews.count for

UIScrollView zoom removes transform from UIImageView

醉酒当歌 提交于 2019-12-24 14:01:10
问题 I have the following code that allows a user to rotate an image on screen by pressing a button. self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, rotationAmount); This image is sitting inside of a UIScrollView which enables a user to zoom in on the photo. The problem is that when a user zooms the transform is reset. I can store the value of the transform and then re apply it after zooming but the image appears as though it is bouncing between the rotated version and

Scrolling horizontal and vertical both direction

▼魔方 西西 提交于 2019-12-24 13:22:15
问题 I have requirement to scroll the images horizontally and vertically. I have sections which will segregated vertically and in each section itself it will be so many images which will be scrolled horizontally . I made vertical scrolling using UICollectionView with Ray wenderlich tutorial but how do I get horizontal scrolling in each section? Should I use any other object like UITableView or UIScrollview for this purpose? Any tutorial available how to achieve this? Is it compulsory to implement

Putting a UIScrollview in a viewcontroller (storyboard)

China☆狼群 提交于 2019-12-24 13:09:04
问题 Hey I want to add a scroll view to my view controller, I have dragged a UIScrollView onto the canvas, it is the required size (228*128). I want this scrollview to scroll a view of size (576*128), i.e. double width. I'm not sure how to go about doing this. Do I first draw the (576*128) view on a separate xib file? How would I link all this up after? The image below is my setup. Do I have to create a custom class for the UIView that contains the content and init this is my view controller? Just

In iOS6, XCode 4.5, UIScrollView is not Scrolling, despite contentSize being set

旧巷老猫 提交于 2019-12-24 13:06:55
问题 I've been banging my head against the wall for the last hour trying to get my scrollView to scroll, but to no avail. In viewDidLoad I have NSURL *url = [FlickrFetcher urlForPhoto:self.photoData format:FlickrPhotoFormatLarge]; NSData *imageRawData = [NSData dataWithContentsOfURL:url]; UIImage *image = [UIImage imageWithData:imageRawData]; self.scrollView.delegate = self; self.imageView.image = image; self.scrollView.contentSize = image.size; self.imageView.frame = CGRectMake(0, 0, image.size

UIScrollView enable paging after screen width goes wider

。_饼干妹妹 提交于 2019-12-24 11:36:16
问题 Here is a screenshot for a ipad application below: This application contains a UIScrollView with several pages. Starting 3 screens, paging is enabled. Then a wider screen Screen 4 comes (There are few more pages after screen4 and before screen5 with varying width in the app.) and paging is disable there. Now i want to again start paging with the start of Screen 5 . Everything works well if Screen 4 is also of width 1024 but if it is wider then enabling paging shows screen 4 and screen 5