uiscrollview

How to make the UIView function like UIScrollView (Objective-C)

北城余情 提交于 2019-12-12 02:29:31
问题 I have a class named Topic . And inside that topic I can create (and delete) Messages . I need to show the messages in a view that can be scrolled/swiped either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView , that how this should look like. Since the messages is being add by the user, I can't use UIImage . I am thinking of the approach that I need to add use UIView instead

how to avoid delay when adding more than one button to scrollview in iPhone?

不羁岁月 提交于 2019-12-12 02:27:06
问题 I need to add more than one button (its depend upon array count) to UIScrollview.Now i am using the following code.This code is working properly but more time ( delay for adding button) taking for this function.Please help me.. for (int i=0; i< [imageArray count]; i++) { NSURL *url = [NSURL URLWithString:[[imgArray objectAtIndex:i]objectForKey:@"url"]]; UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:url]]; UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];

Dynamically set UIScrollView and UITableView height by its content

隐身守侯 提交于 2019-12-12 02:19:15
问题 Im quite new to iOS development and i've been stuck with this for a couple of days i have a UITableView and UIImageView inside a UIScrollView , the UIImageView is on top of the table and the height is static so i don't have any issues with that, the problem is the UITableView , i need to get the height dynamically based on the content and set that height to a height constraint of the table and the contentsize of the scrollview. The cells are self sizing, so the height of the cell varies

Create a loop on UIScrollView

淺唱寂寞╮ 提交于 2019-12-12 01:57:14
问题 I can scroll back and forth on the views but I can't loop the views so it scrolls back when I'm on ViewController3 and forward on ViewController1 to create a loop. How would I do this? The code below is what I've done so far. import UIKit class ViewController: UIViewController { @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() let vc0 = ViewController0(nibName: "ViewController0", bundle: nil) var frame0 = vc0.view.frame frame0.origin.x = self.view

Auto Layout + UIScrollView and single subview

孤街浪徒 提交于 2019-12-12 01:54:10
问题 Just playing around with Auto Layout and UIScrollView. What am I missing here? This displays a blue scrollView at the bottom of the screen but I cannot see the contentView. The view debugger has nothing to say for it either. Any ideas? // // ViewController.m // Fit // // Created by Adam Dahan on 2015-03-13. // Copyright (c) 2015 Adam Dahan. All rights reserved. // #import "ViewController.h" @interface ViewController () { UIScrollView *scrollView; UIView *contentView; } @end @implementation

UIScrollView Content Size with Autolayout

守給你的承諾、 提交于 2019-12-12 01:51:20
问题 I am using UIScrollView with Auto-layout to change contentS enter code here ize value as following : UIView ScrollView UIView ( contentView ) In run time I am adding UITextView & UIImageView to conentView with constraint(Top,Bottom,Left,Right) but the contentView size is not changing and UIScrollView contentSize also. So what could be the problem ? 回答1: In run time I am adding UITextView & UIImageView to conentView with constraint(Top,Bottom,Left,Right) Maybe you should add constraint (Top,

UIScrollView AutoLayout With 'Footer' Pinned to Bottom of Screen

醉酒当歌 提交于 2019-12-12 01:49:49
问题 I have been banging my head against a wall for a while with this. I need to have a UIScrollView with an arbitrary number of labels under each other and then have a header pinned to the top and a footer pinned to the bottom of the screen. All this needs to be using auto layout. Is this possible at all? Any help would be appreciated Thanks, Alex Crompton 回答1: Yes, I believe it has to look like that http://kernelmd.tumblr.com/image/114897924655 Just pin upper view to the top, bottom to the

Having trouble hiding keyboard using invisible button which sits on top of uiscrollview

▼魔方 西西 提交于 2019-12-12 01:47:57
问题 I have 3 items in play... 1) UIView sits at the base of the hierarchy and contains the UIScrollview. 2) UIScrollview that is presenting a lengthy user form. 3) An invisible button on the UIScrollview that I'm using to provide "hide the keyboard" features. Notice in the code below that I'm registering to be notified when the keyboard is going to appear and again when it's going to disappear. These are working great. My problem is seemingly one of "layers". See below where I insert the button

how to add subview to subviews of scroll view

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:47:37
问题 how create this view. code for adding scroll view yPos=0; for (int i=0; i<24; i++) { UIView *timeView=[[UIView alloc]initWithFrame:CGRectMake(71, yPos, 909, 60)]; timeView.userInteractionEnabled=TRUE; timeView.exclusiveTouch=YES; if (i==4) { UIView *ssview=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 80)]; ssview.tag=1; ssview.userInteractionEnabled=TRUE; UILabel *recurenceId=[[UILabel alloc]init]; recurenceId.text=@"A12334"; [ssview addSubview:recurenceId]; ssview.backgroundColor=

ios UITextView not displaying correctly (bug?)

陌路散爱 提交于 2019-12-12 01:44:53
问题 I have 10 UITextView s laid out horizontally in a UIScrollView that has paging enabled. when my view is initd and brought to view, the initial page's UITextView 's text does not appear. The background color shows up fine, but the text is not visible on screen. Here's the phenomenon: As soon as you drag the UIScrollView even 1px the text magically displays it's self. What's the deal? How can I fix this? ** edit - code for kai ** [self.messageBodyTxt setFont:[UIFont fontWithName:@"MuseoSlab-300