uiscrollview

Need Help in applying constraints to UIScrollView

可紊 提交于 2019-12-13 10:37:29
问题 I'm adding subviews programmatically. Requirement : when extra views are added the scroll should be enabled. The constraints that I applied : To remove extra spaces at the top I wrote self.automaticallyAdjustsScrollViewInsets = false also give content size as self.scrollView.contentSize = CGSize(width: self.contentView.frame.width, height: self.contentView.frame.height*2) But the when the view is loaded scroll is completely disabled. Please help me 回答1: When you using auto layout, you have to

Expected ':' Lexical or Preprocessor error

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 09:57:12
问题 Well this should be a pretty quick and easy question. I am creating a scrollview and i have it all done, but there is an error that i just dont understand it! like its just confusing and doesnt make sense to me! THE ERROR: // Expected ':' ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController{ } @property (weak, nonatomic) IBOutlet UIScrollView *ScrollView; @end ViewController.m @interface ViewController () @end @implementation ViewController - (void)viewDidLoad

how to add sounds while uiscrollview is scrolling [duplicate]

懵懂的女人 提交于 2019-12-13 09:13:36
问题 This question already has answers here : How to add sound while UIScrollview is scrolling in iphone sdk? (2 answers) Closed 3 months ago . -(void)layoutScrollImages { UIImageView *view = nil; NSArray *subviews = [scrollView1 subviews]; CGFloat curXLoc = 0; for (view in subviews) {if ([view isKindOfClass:[UIImageView class]] && view.tag > 0) { CGRect frame = view.frame; frame.origin = CGPointMake(curXLoc, 0); view.frame = frame; curXLoc += (kScrollObjWidth); } } [scrollView1 setContentSize

Change height and width of view according to scrollview scroll horizontally using auto layout

孤人 提交于 2019-12-13 08:54:25
问题 Container View hierarchy:- Container View Scrollview view left view center view right FloatingBottomView I need to change height and width constrain of FloatingBottomView according to scrollview scroll horizontally. Initial Outlet:- @IBOutlet weak var constantFloatingBottomViewWidth: NSLayoutConstraint! // 300 @IBOutlet weak var constantFloatingBottomViewHeight: NSLayoutConstraint! // 70 override func viewWillAppear(_ animated: Bool) { self.scrollView.contentOffset.x = self.view.bounds.width

How can i make my CATextLayer object Scrollable like UITextView?

不羁岁月 提交于 2019-12-13 08:26:33
问题 I have used CATextLayer for Displaying bold and Normal text together.Now some time i am getting long text from the Web Service response so i am not able to display complete text.Can any one please help me what should be the way to make CATextLayer object Scrollable like textview.Please suggest me any solution regarding this.I have also take reference from Here but it's not working for me. I am using this code: /* Create the text layer on demand */ if (!_textLayer) { _textLayer = [[CATextLayer

ScrollView start scroll only second time that the view appear

北慕城南 提交于 2019-12-13 07:39:20
问题 I've a problem with my view in iOS7 with autolayout. This is my structure: The UITextView content is dynamic so I fit his contentSize dynamically in the viewDidLoad . In my viewDidAppear I try to fit the contentSize of the MainScroll and the mother view calculated by the sum of UIScrollView height (the little one), Pager height and UITextView height. I logged this height and it returned the correct size: 1300px but the view doesn't scroll. If I change tab and return here the scroll start to

UIScrollView subviews contents size issue

和自甴很熟 提交于 2019-12-13 07:35:02
问题 I am using a scrollView, in which i have added some static content in a container view and below this container view i have added a web view and added both these views into my scrollView, I dont want the web view to be scroll, instead I want that my scrollview should scroll according to the height of my container view and height of contents in web view. Note: I am loading contents in webview as html string, that i am receiving from server, The contents are coming in between of html tags and i

Implement UITableView from different ControllerClass as Subview

醉酒当歌 提交于 2019-12-13 06:26:11
问题 I'm trying to implement a TableView from a different (Table)ViewController into a Scrollview. I'm literally trying for hours now and I can't figure out the problem. The error I get is: -[UISectionRowData numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x687fdb0 2012-05-07 16:47:18.966 Test2[12212:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISectionRowData numberOfSectionsInTableView:]: unrecognized selector sent to instance

uiscrollview in uiview not scrolling

筅森魡賤 提交于 2019-12-13 06:24:15
问题 I am using the storyboard to create a UIView that contains a UIScrollView that has many child items in it. these child items consist of a UIImageView that I am using as a background image for the UIScrollView , a series of UILabels that I populate programmatically, and a series of UITableViews that I populate with data obtained from a called set of library classes. I want all of this in my UIScrollView so the User can scroll through all of the information without having multiple views being

iOS: scrollView not scrolling to correct position when keyboard visible

浪子不回头ぞ 提交于 2019-12-13 05:24:15
问题 I am testing my iOS app using a 6.1 simulator. I have been working for hours to scroll my scrollView to the correct position when a keyboard is visible (after a user clicks on a textView). I have tried following the answer marked as correct on this page: How do I scroll the UIScrollView when the keyboard appears? This is what I currently have: - (void)keyboardWasShown:(NSNotification*)aNotification { NSLog(@"keyboardWasShown"); NSDictionary* info = [aNotification userInfo]; CGSize kbSize = [