uiscrollview

UIScrollView dynamically resize UILabel

随声附和 提交于 2019-12-25 08:56:10
问题 i have got a UILabel which is not static. I want to resize my scroll view so that it fits the label. Here is my idea now: self.scrollView.contentSize = CGSizeMake(320.0, 92+self.contentLabel.frame.size.height); 92 stands for pixels from where my label start. (there is a heading too) But it doesn't work, it seems to be connected with Interface Builder also. Thanks guys. 回答1: You need to set the frame as well. The contentSize of the scrollview is just what is within, not the frame of the view

Scrollview stopping at a certain point

若如初见. 提交于 2019-12-25 08:54:04
问题 Hi I currently have a horizontal UIScrollView that allows me to pick a character in my game and then select it but the problem that I have now is I am trying to get the scrollview to stop at the point where the sprite/character is in the middle of the screen and instead of having it stop anywhere. My UIScrollView has a “moveable node” that contains multiple pages that hold all the sprites as seen below: scrollViewHorizontal = CustomScrollView(frame: CGRect(x: 0, y: 0, width: self.frame.size

make view controller scrollable with collection view

被刻印的时光 ゝ 提交于 2019-12-25 08:46:28
问题 I need to create a view controller like this or like user instagram's profile not exactly same, I just want to add label and buttons and collection view, but I want all of this in scroll viewController I think I can't do that from storyboard, so how I can make a view controller scrollable programmatically? and then I want to add the label and buttons inside the scroll , I can do that programmatically , but how I can add collection programmatically inside it? 回答1: One of the possible solutions

ScrollView of images in ios

荒凉一梦 提交于 2019-12-25 06:33:16
问题 Hi my requirement is showing image in scrollview along with that it should display next and previous button.User can scroll the image as well as use buttons to move images. I have doubt about how to get the index / tag / imagename or anything else when user scroll based on that values buttons should be updated. Here is my Code [self arrayInitiaisation]; scrollview.pagingEnabled = YES; scrollview.alwaysBounceVertical = NO; scrollview.alwaysBounceHorizontal = YES; NSInteger numberOfViews = 4;

UIScrollView when Autolayout is turned on (StoryBoard)

杀马特。学长 韩版系。学妹 提交于 2019-12-25 06:20:50
问题 I was wrestling with UIScrollview and it knocked me out. I tried to take reference from following two post on stackOverFlow scrollview xcode4.5 autolayout, Xcode 4.5 UIScrollView, Embed ImageView in ScrollView with Auto Layout on iOS 6, I tried viewDidLayoutSubviews, as told in UIScrollView setContentSize breaks view with Auto Layout that is causing my app to crash. And I tried ViewDidLoad, viewDidAppear and viewWillAppear but nothing worked. I tried google and found couple more related post

Not able to change the frame of UIButton Programmatically.?

人盡茶涼 提交于 2019-12-25 05:33:35
问题 I am trying to add more textfields in my View, Textfield is getting added but the button is not changing the frame . And its gone inside the uitextfield which i have added . Please let me know where i am getting wrong . Thanks I am sharing the code snippet here itself. -(IBAction)addMore:(id)sender { UITextField *moreText = [[UITextField alloc] initWithFrame:CGRectMake(20, textfieldy, 280, 44)]; CGRect buttonFrame = self.addmore.frame; buttonFrame.origin.y += 10; self.addmore.frame =

Storyboard scroll view with text boxes

半城伤御伤魂 提交于 2019-12-25 05:16:17
问题 I am creating a view in a storyboard that has a bunch of text boxes with a button at the bottom. When I click in the text box the keyboard appears. This hides some of my text boxes. All text boxes live within the scrollview. Is there a way in storyboarding (if not then in code) to make the scrollview scroll properly amongst all the content when the keyboard appears? Do I have to dynamically change the content size when the keyboard appears, or is there a way that I can set up the scroll view

ios, scrolling screen with a few objects without zooming

百般思念 提交于 2019-12-25 04:59:15
问题 I have screen w/ a few labels. Each of them might be from 1 to a dozen lines. So some times all content not to fit on screen so scrolling is necessary. All seem to be easy and there are a lot of tutorials how to do it. But my problem that scrolling works only when I zoom in screen. Setting "contentSize" doesn't give any effect. @interface OMSScroolViewController : UIViewController <UIScrollViewDelegate> @property (strong, nonatomic) IBOutlet UIScrollView *scroll; @property (strong, nonatomic)

How to make a UIScrollView with a UITextView sub view not scroll when adding text?

百般思念 提交于 2019-12-25 04:33:31
问题 I have a UIScrollView which has a subview UITextView. When I added text to UITextView by code, the view is scrolling to the last line. I want the view not to scroll when I add text to UITextView by code. Anyone can help me fix the problem? 回答1: Finally I can fix my problem. We just set YES the setScrollEnabled in UITextView before we change the text in UITextView and set NO after we change the text. Here the example code [yourTextView setScrollEnabled:YES]; yourTextView.text = [someString

Sketch On UIView Within UIScrollView

懵懂的女人 提交于 2019-12-25 04:23:20
问题 I am having an issue when trying to sketch on a UIView that is a child view in a UIScrollView . The problem occurs when you try to sketch on the UIView after it's been zoomed or scrolled on. It seems my sketch code (shown below) does not take into account the zoom or scale of the UIView within the UIScrollView because the lines blur and don't show up where they should. Please let me know if there is something that can be done to my code or provide another solution. - (void)touchesBegan:(NSSet