uiscrollview

Swift iOS Set scrollView constraint below navigation bar programmatically

China☆狼群 提交于 2019-12-18 15:05:27
问题 My UIViewController is embedded in a navigation controller. I programmatically add the navigation buttons and now trying to add a scrollView below this navigation bar. The problem I'm having is this is filling the full frame size and going under the navigation bar. How do I programmatically set constraints of this scrollview? var scrollView: UIScrollView! var containerView = UIView() override func viewDidLoad() { super.viewDidLoad() self.navigationItem.title = "Filters" // add some buttons on

Infinite horizontal scrolling UIScrollView

大城市里の小女人 提交于 2019-12-18 13:32:07
问题 I have a UIScrollView whose content size is 1200x480. I have some image views on it, whose width adds up to 600. When scrolling towards the right, I simply increase the content size and set the offset so as to make everything smooth (I then want to add other images, but that's not important right now). So basically, the images currently in the viewport remain somewhere on the left, eventually to be removed from the superview. Now, the problem that I have happens when scrolling towards the

How to make a vertical UITextView by subclassing it from UIScrollView in Swift?

烂漫一生 提交于 2019-12-18 12:52:44
问题 Background I'm new to iOS development, but in order start making even the most rudimentary apps using the vertical Mongolian script, I need to have a vertical UITextView . I haven't found any other Mongolian app developers sharing their code so I am trying to make it myself. Mongolian is written from top to bottom and lines wrap from left to right as is illustrated in the following graphic: Scrolling should be horizontal (left to right). In a previous question I proposed a combination of a

UIScrollview animation depending on content offset

北城以北 提交于 2019-12-18 12:37:41
问题 I'm using a horizontal UIScrollView, and I want a background color transition depending on the x value of the content offset. Example: The width of UIScrollView is 640px. When the content offset is equal to 0px, the background color must be red. When the content offset is 320 px, the background must be yellow. But the most important part is, when the UIScrollview is between 0px and 320px the background color must be between red and yellow. Hint: The twitter app for iOS has the same animation

Scrollview with embedded tableview

心不动则不痛 提交于 2019-12-18 12:28:06
问题 I'm building an iOS app in swift with Xcode 6. I'm trying to embed a view controller with a table view in a scrollview. When the user drags in the table view, it is suppose to move the table, not the the scrollview that it is embedded in. I've made this illustration, to clearify my view and view controller hierachy: The red area is the content size area of the scrollview . The green and blue areas are different view controllers , embedded in the scrollview. The yellow area is a Text field in

How to force UICollectionView with fewer items to scroll?

泪湿孤枕 提交于 2019-12-18 12:22:42
问题 I am working with a UICollectionView that displays fewer items than necessary to fill the whole screen. With this setting, the view simply does not scroll (move and bounce), when I add like 20 items it works. How can I force the collection view to scroll, without enough items to fill the screen? (source: bytolution.com) Thanks for your help! BTW I already tried to set the contentSize (e.g. to {320 , 1000}) but it still does not work. 回答1: Try to set alwaysBounceVertical property to YES : self

Why won't UIScrollView scroll fully after adding objects? Using storyboard, ARC, and Xcode 4.5.2

蓝咒 提交于 2019-12-18 12:04:04
问题 So, I know there are similar questions to mine, but maybe not exact (so please don't mark me down -- just warn me or something). I have searched for days for the solution to this SIMPLE issue. Using storyboards, ARC, and Xcode 4.5.2, I simply need to put a bunch of labels inside a UIScrollView and have it scroll vertically. I've tried so many combinations of setting frame sizes and content sizes within viewDidLoad, viewDidAppear, and viewWillAppear, but to no avail. The scroll view scrolls

Adding UIScrollView to a UIViewController

六眼飞鱼酱① 提交于 2019-12-18 11:57:39
问题 I have a UIViewController , and I want to add a UIScrollView to it (enable scroll support), is it possible? I know it is possible, if you have a UIScrollView to add a UIViewController to it, but I'm interested also if reverse was true, if I cann add a UIScrollView to an existing UIViewController , such that I get scrolling feature. Edit I think I have found an answer: Adding a UIViewController to UIScrollView 回答1: An UIViewController has a view property. So, you can add a UIScrollView to its

does removefromsuperview releases the objects of scrollview?

强颜欢笑 提交于 2019-12-18 11:55:38
问题 for(UIView *subview in [scrollView subviews]) { NSLog(@"subviews Count=%d",[[scrollView subviews]count]); //[subview release]; [subview removeFromSuperview]; } in the above method if i use [subview removeFromSuperview]; it works fine...but if i use [subview release]; It crashes..i want to know that if both are same or is there any difference between them? 回答1: @MathieuK is correct, but it's worth digging deeper into this, because it's a very important concept in ObjC. You should never call

does removefromsuperview releases the objects of scrollview?

故事扮演 提交于 2019-12-18 11:55:08
问题 for(UIView *subview in [scrollView subviews]) { NSLog(@"subviews Count=%d",[[scrollView subviews]count]); //[subview release]; [subview removeFromSuperview]; } in the above method if i use [subview removeFromSuperview]; it works fine...but if i use [subview release]; It crashes..i want to know that if both are same or is there any difference between them? 回答1: @MathieuK is correct, but it's worth digging deeper into this, because it's a very important concept in ObjC. You should never call