uiscrollview

UIScrollView with dynamically sized content

陌路散爱 提交于 2020-02-12 05:26:04
问题 (Xcode 11, Swift) Being a newbie to iOS and Autolayout, I'm struggling with implementing a fairly simple (IMHO) view which displays a [vertical] list of items. The only problem is that items are decided dynamically and each of them could be either text or image (where either of those could be fairly large so scrolling would be required). WebView is not an option, so it has to be implemented natively. This is how I understand the process: Make in IB a UIScrollView and size it to the size of

Dynamically set UIScrollView height and UITableView Height depending on content

为君一笑 提交于 2020-02-06 05:47:27
问题 Setup : I have a scrollview with a label, uiimage, and a tableview (grouped) nested within. The label, uiimage, and tableveiw are populated by a webservice. The last section in the grouped table view contains text that will never be the same and could be as long as 5 characters to 250+. Also, this view is pushed from a basic tableview (so it has a navigation bar. If that matters at all). Expected : The tableview should extend in height depending on the length of the content received from the

Dynamically set UIScrollView height and UITableView Height depending on content

情到浓时终转凉″ 提交于 2020-02-06 05:47:12
问题 Setup : I have a scrollview with a label, uiimage, and a tableview (grouped) nested within. The label, uiimage, and tableveiw are populated by a webservice. The last section in the grouped table view contains text that will never be the same and could be as long as 5 characters to 250+. Also, this view is pushed from a basic tableview (so it has a navigation bar. If that matters at all). Expected : The tableview should extend in height depending on the length of the content received from the

UICollectionView and UIView into UIScrollView

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-05 08:41:06
问题 I need to know how to do to embed a UICollectionView and a UIView within a UIScrollView, but that everything moves with the scroll of UIScrollview. the layout is something like the following image: 回答1: Why don't you use the view as the collectionView 's section supplementary view (see docs)? It will become part of the collectionView thus scrolling of the collectionView will handle also the view itself. 回答2: 1- Drag a UIScrollview to your vc give it leading , trailing , top and bottom

make an uisegmentedcontrol in an uiscrollview

那年仲夏 提交于 2020-02-02 10:36:27
问题 I want to use a very large segmentedcontrol component so I had the idea to make it in a uiscrollview ..so by scrolling horizontally user can choose the appropriate item. I wrote this code: CGRect rect = [[UIScreen mainScreen] applicationFrame]; CGRect frame = CGRectMake(rect.origin.x + kLeftMargin, rect.size.height - kPaletteHeight - kTopMargin, 2*rect.size.width , kPaletteHeight); seg.frame = frame; scroll.frame = frame; scroll.contentSize = CGSizeMake(frame.size.width * 2,frame.size.height)

UIScrollView

限于喜欢 提交于 2020-01-31 23:00:46
UIScrollView的基本使用 将需要显示的内容添加到UIScrollView中 设置UIScrollView的contentSize属性,告诉UIScrollView所有内容的尺寸,也就是告诉它滚动的范围 //ViewController.m # import "ViewController.h" @interface ViewController ( ) //连线 @property ( nonatomic , weak ) IBOutlet UIScrollView * scrollView ; @end @implementation ViewController - ( void ) viewDidLoad { [ super viewDidLoad ] ; //1.红色的view UIView * redView = [ [ UIView alloc ] init ] ; redView . backgroundColor = [ UIColor redColoe ] ; redView . frame = CGRectMake ( 0 , 0 , 30 , 40 ) ; [ self . scrollView addSubviews : redView ] ; //设置内容超出UIScrollView后仍然能看见 self . scrollView .

How to move the focussed text field to the middle of the view after keyboard popups

我怕爱的太早我们不能终老 提交于 2020-01-26 04:05:06
问题 In my iPad im creating SplitView application. I have a UITableVewtable with multiple rows, each row/cell having three UITextField When i tap on UITextField some fields are hide by the keyboard. So im using TPKeyboardAvoidingScrollView framework but it does not works on ios 5.0+. some times unable to scroll the scroll view on the table. So I want to move the focussed cell to the middle/ just above the key board at every time What should I use? Thanks in Advance. 回答1: Try this code. Put this in

Scroll View without Auto Layout

▼魔方 西西 提交于 2020-01-26 03:13:05
问题 In my app I have buttons in a UIScrollView that when they are clicked it displays text in a UITextView . In my app I can't use auto layout; but my UIScrollView won't work. How can I use UIScrollView when I don't have "use auto layout" on? 回答1: This worked for me: .h IBOutlet UIScrollView *scrollerName; .m [viewDidLoad] [Scroller setScrollEnabled:YES]; [Scroller setContentSize:CGSizeMake(x, y)]; self->Scroller.autoresizingMask = (UIViewAutoresizingFlexibleWidth |

Loading images on scrollview using lazy loading

◇◆丶佛笑我妖孽 提交于 2020-01-25 11:45:12
问题 I am working on an app in which I need to load nearly 211 images in a scrollview. What I was doing was I was converting the images in binary format (NSData) and saving them in core data. Then retrieving them and populating them on the scrollview. it does work, but sometimes it does throw "Memory warning". I learned that lazy loading is a way to achieve this. But, I am not totally aware of how it is done. Like, loading 3 or 5 images ahead/back of the image visible currently on the scrollview.

Logic for adding images and scroll icon to the table view

末鹿安然 提交于 2020-01-25 11:25:05
问题 I have a table view, and I am adding four UIImageView s to a row, so in total I have five rows and twenty image views. I am inserting images one by one into the cell. The second row will only start to fill once all four image views are filled. I need some logic for this. I mean, how can I check which place is next to be filled in the table view and at which event? How can I add images one by one to the UIImageView s? Also, initially only two rows will be shown. After filling these two rows,