uiscrollview

How can I programmatically force-stop scrolling in a UIScrollView?

非 Y 不嫁゛ 提交于 2019-12-17 05:41:47
问题 Note: The answer given here doesn't work for me. I have a UIScrollView (not a table view, just a custom thing), and when the user takes certain actions, I want to kill any scrolling (dragging or deceleration) inside the view. I've tried doing e.g. this: [scrollView scrollRectToVisible:CGRectInset([scrollView bounds], 10, 10) animated:NO]; on the theory that, given a rect that's already known visible, the scrolling will just stop where it is, but it turns out that this doesn't have any effect-

How do I reset after a UIScrollView zoom?

爷,独闯天下 提交于 2019-12-17 03:48:16
问题 I have a Graph being drawn inside a UIScrollView . It's one large UIView using a custom subclass of CATiledLayer as its layer. When I zoom in and out of the UIScrollView , I want the graph to resize dynamically like it does when I return the graph from viewForZoomingInScrollView . However, the Graph redraws itself at the new zoom level, and I want to reset the transform scale to 1x1 so that the next time the user zooms, the transform starts from the current view. If I reset the transform to

EXC_BAD_ACCESS when I scroll my view

做~自己de王妃 提交于 2019-12-16 18:03:13
问题 I have two views: the first one is a UITableView in plain style (created programmatically); the second one is a UIScrollView that contains an image and a UITableView in grouped style (also created programmatically). When I navigate from the firstView -> secondView everything works fine. However if I come back to the firstView and then I try to navigate firstView ->secondView for the second time, I get a EXC_BAD_ACCESS error. UPDATE This is the code of the UITableView delegate in the

EXC_BAD_ACCESS when I scroll my view

孤者浪人 提交于 2019-12-16 18:03:09
问题 I have two views: the first one is a UITableView in plain style (created programmatically); the second one is a UIScrollView that contains an image and a UITableView in grouped style (also created programmatically). When I navigate from the firstView -> secondView everything works fine. However if I come back to the firstView and then I try to navigate firstView ->secondView for the second time, I get a EXC_BAD_ACCESS error. UPDATE This is the code of the UITableView delegate in the

Horizontal scroll with buttons in iOS

≯℡__Kan透↙ 提交于 2019-12-14 03:42:32
问题 I have implemented following horizontal scroll with buttons, but it seems like it starts scrolling only after 5 seconds. It got stuck. UI is getting blocked, I guess. I have following code to create that in my ViewDidLoad() UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,self.view.frame.size.height-100, self.view.frame.size.width, 100)]; int x = 10; for (int i = 0; i < 10; i++) { UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x,10,80,80)]; [button

How to update constraints after adding UIView from xib on UIScrollView in swift?

亡梦爱人 提交于 2019-12-14 03:23:34
问题 I have a UIViewScroll (background color is blue) in view controller. I need a UIView (background color is white) that were from Xib. The Xib view has a UILabel (background color is green) with constraints. Now, the problem is UILabel constraints not applied after adding it to scrollView . How to add UIView without loss of constraints? Refer following screenshots and code. Note: I need to just update constraints of the sub views of the UIView without using IBOutlets of NSLayoutConstraints .

Crash when pushing cell to DetailView when it's a UISCrollView using XCode 4

情到浓时终转凉″ 提交于 2019-12-14 03:19:43
问题 I use this code to move to DetailView from TableView: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:TRUE]; if(indexPath.row==0) { //Initialize the detail view controller and display it. Detail1ViewController *firstDetailController = [[Detail1ViewController alloc] initWithNibName:@"Detail1ViewController" bundle:nil]; [self.navigationController pushViewController:firstDetailController animated

How to scroll UI tableview vertically and horizontally?

不打扰是莪最后的温柔 提交于 2019-12-14 03:17:04
问题 i have table view in my app and each row have long text so its possible to scroll whole table so user can read entire text also i am using following code to set up my cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //buttonCount=0; static NSString *CellIdentifier = @"Cell"; static NSUInteger const kLeftLabel = 100; static NSUInteger const kRightLabel = 101; row = [indexPath row]; UITableViewCell *cell = [tableView

How start animation of activity indicator when click on button?

孤街浪徒 提交于 2019-12-14 03:09:51
问题 I have code in which I have array of view in scroll view. In each view I create image view and button. Now i want to set a event on button that is when click on button then activity indicator will appear on view and start animation and when finish upload of next view or image then stop and hide activity indicator. What I will do in code so that it work? How do that? In short i want to display activity indicator on view when click on button and hide when neat view appear. 回答1: make a function

UIButton inside UIScrollView, inside UIScrollview

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 02:25:22
问题 Controller A's view contains a UIScrollview which contains a UIButton. The content scrolls vertically and the button works fine. Controller B's view contains a UIScrollview for paging left and right. When I place my Controller A view inside the scroll view of Controller B's the UIButton stops working. I can't 'de-nest' the scrollviews because they are managed by independent controllers - and paging is only required under certain circumstances. Why does Controller B stop the button from