Questions tagged [contentsize]

118 questions
2
votes
3 answers

UIScrollView ContentSize.height is 0.0000 by default?

I am trying to create a dynamic form using a UIScrollView, but I noticed when I used a NSLog that my scrollView's contentSize.height = 0.00000 I built the scrollView to the width and height of the screen on storyboard with elements inside it. So why…
Alan
  • 8,681
  • 12
  • 48
  • 90
2
votes
0 answers

What is the best practice to auto resize the "ContentSize" of an UIScrollView?

I have to display a few views in a UIScrollView and I want it to fit the subviews. Are there any methods that could help me? It doesn't seem hard for a UIView to resize itself according to its children but I can't find any method do such a thing. I…
2
votes
0 answers

exc bad access when change the contentSize of popover

I have a button to trigger the popover, and a checkbox on the popover. The state checkbox of the checkbox is bound to a field 'checkboxState' of an NSManagedObject. Here is the scenario: I click the button, the popover will show up. I check the…
Jensen
  • 1,545
  • 4
  • 24
  • 42
2
votes
4 answers

Scrolling Issues in IOS

Scroll view did not set content size if I set it using a dynamic variable i.e. scrollView.contentSize=CGSizeMake(320,scrollView.frame.origin.y+120); the scroll view size remains same after calling above method. But if I set it using a number…
2
votes
3 answers

UIScrollView not scrolling off screen?

I have an app in which a UIScrollView of the dimensions 1056x96 on top of a screen which is 480x320 (it is in landscape.) It contains 9 UIBUttons. It definitely is able to scroll, as when I set 'bounces horizontally' to true I can clearly see it…
Fitzy
  • 1,803
  • 6
  • 23
  • 38
1
vote
1 answer

UIScrollView content size clipping subviews when it shouldn't

I have a UIScrollView that contains several dynamically resizing subviews. I can resize and layout the subviews just fine, but when I set the content size of the scroll view itself, the bottom subviews are clipped. Is there some reason why a scroll…
1
vote
2 answers

Couldn't get the correct height of the wkWebView?

I have read lots of articles about how to get height of the webView. Most of them use KVO to observe the contentSize. I also did that. 1) create wkWebView and forbid webView's scrollView lazy var webView: WKWebView = WKWebView() …
Longshihua
  • 315
  • 2
  • 18
1
vote
2 answers

Self sizing specific UITableView Cell

I know how to make UITableViewCells self size in UITableView. The question is how to only a specific cell self size itself. I have four different custom UITableView Cells in my table and I want to make only one cell self size itself.
1
vote
1 answer

problem with scrollview content size on ipad in landscape

In viewdidload I have this code: [methodPanes setContentSize:CGSizeMake(numberOfPages*methodPanes.frame.size.width, 100)]; Method panes is set relative to the width of self.view. The problem is that if I load the view from landscape format on the…
Thomas Clayson
  • 28,448
  • 25
  • 135
  • 216
1
vote
1 answer

get textView contentsize height is wrong in iOS 8

use masonry had setup textView's constraints, get textView.contentSize.height after [textView layoutIfNeed], this value is -8 this bug is only in systemVersion less than 9.0 find a method and try: [[textView layoutManager]…
Archerlly
  • 183
  • 10
1
vote
3 answers

Swift set height of table

I have this table for which I want a certain height even when I only have one row. I want to make it scrollable (empty space at the bottom) even when I do not have enough rows to cover the whole screen. I think I should work with:…
asheyla
  • 2,597
  • 4
  • 14
  • 30
1
vote
0 answers

Controls in a UIScrollView won't work below screen height

I have UIButtons/UISliders around 900 pixels down a UIView which is on a UIScrollView. I am alloc/init the scrollView and the UIView frame at 0,0,375,950 and setting the scrollView.contentSize to the same and have enabled userInteraction. Yet I am…
Sevy11
  • 131
  • 2
  • 5
1
vote
0 answers

How to change the line spacing of the first line of text in a UITextView only when there's more than one line of text rendered?

I have a subclass of UITextView used to display a custom view within the text flow. It's adding an exclusionPath for the custom view, and rendering it's content within that region using autolayout. That part is working, and the text wraps around…
Goines
  • 71
  • 1
  • 4
1
vote
2 answers

Why my UIView inside UIScrollView doesn't respect its height contraint?

I would like to make a simple UIScrollView. For that I put an UIView inside it, and put all my components inside this UIView. My problem is that I programmatically set the contentSize of my UIScrollView (and it works perfectly), but my UIView…
Will
  • 101
  • 11
1
vote
2 answers

Tableview frame issue when put in a scrollview

I wanted to post a gif but apparently I don't have enough reputation. Oh well, whatever; I was using UIPageViewController, but for some reason I decided to go with a more manual solution by using UIScrollView and adding the views of…
Kerem
  • 57
  • 9