I am having problem when making a long scroll view with images. It will be difficult for users to scroll down for so long to get to that image or button. Is there any ways that i can create some buttons on the top of the scroll view, while pressing these buttons that can directly scroll down to the specific position that i want? (scroll down animated will be good)
Many thanks.
- (IBAction) yourBtnInScrollViewPressed : (id) sender
{
[yourScrollView scrollRectToVisible:CGRectMake(x, y, yourScrollView.frame.size.width, yourScrollView.frame.size.height) animated:YES];
}
Related
I have a subview of a scrollView where there are some images. That images have the UILongPressGestureRecognizer property.
Opening the view, there are some images visibles and others that are not visibles. To show them, scroll is needed.
The problem is that GestureRecognizer action works well on visibles elements of the subview but not on elements that appear when user scroll. I verify that:
- (BOOL)gestureRecognizer:(UILongPressGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
is called only when visible immages are touched, but not on the images hided by scroll.
User interaction are enable both on scroll and subview where elements are.
Any help will be appreciated.
After some days, I solved the problem.
In my case, when I adjust the height of the subview to the table, I was using the table frame size.
[mySubview setHeight:myTable.frame.size.height];
so the gesture recognize was hided from the dimension of the frame.
Changing with the content size
[mySubview setHeight:myTable.contentSize.height];
it works.
I hope it helps.
I have a right hand panel area in my app that's a tall vertical custom view (let's call this the column view) that contains 2 tableviews. Each tableview does not scroll, and although they are embedded in the standard clipview and scrollview, the vertical height of the tableview is the same as the total number of rows it contains, and bounce is disabled. As the number of rows increases, the background column view increases in height and needs to scroll vertically. It's also embedded in a scrollview. This sounds more complicated than it is, here's a pic:
Scrolling of the background column view works fine as long as the mouse pointer is not inside the red boxes, i.e., over the tableviews. I want to be able to vertically scroll regardless of where the mouse is located within the column view. Any ideas?
Update: here's a mainstream example of where tableviews embedded in a scrollview work correctly, in Tweetbot (assuming those sections are tableviews)
If you want to have scroll view inside other one (red area). You need to disable inner scroll view scrollWheel action. You can achieve that by writing custom NSScrollView subclass, and adding following method :
- (void)scrollWheel:(NSEvent *)theEvent {
// If scroll is disabled, send action to next responder
if (self.scrollEnabled == NO) {
[self.nextResponder scrollWheel:theEvent];
}
else {
[super scrollWheel:theEvent];
}
}
But don't think you need to have scroll view inside other scroll view. Rather you could use one table view with 2 kinds of cells, one for 'section header' and other for 'cell'.
This way you have one table view with multiple sections - just like in iOS.
In my app I have UIView that flow through the use of a horizontal scrollView. To scroll the view I used the classimo method [self addChildViewController: [self.storyboard instantiateViewControllerWithIdentifier: # "name Storyboard ID"]];
Each UIView is followed through the use of UIPageControl classic, but I do not like it and so I wanted to create something like this (see photo)
as you can see from the images above application there is a menu with a triangle pointing down, Indicating the page, passing from one topic to another user through the horizontal swipe on the scrollView
In other words, instead of having the classic shot for the management of the pages, the National Geographic has used a triangle pointing down and the title of the page on which the user is ...
Could someone help me understand how can 'be created a similar PageControl?
There are a lot of approaches to implement this. Maybe the custom PageControl won't be the subclass of a UIPageControl.
For example, you can subclass a UIView, and put a UIScrollView in it. And then put a bunch of UIButtons in a row into the UIScrollView, each of them has a title that is your page's title. When you tap a button ( you can get this event by UIButton's -addTarget:action:forControlEvents:), you can scroll the tapped button to the right position, highlight it, and put a little triangle below it.
There are many possibilities. Say, you can replace the buttons with UILabel and add UITapGestureRecognizer to capture the users tap, or you can replace the UIScrollView with UITableView if you get a long list of pages(Of course that will introduce some complexity). You just need to pick your favorite and try it out.
firstly, i want add 3 subviews with textview, image also edittext ;
view1 ; image,
view 2 : text, image,
view 3 : text, label
i want to scroll with async or with swipe
i used image scroll but can't find subviews
thanks for sharing
You can use an UIScrollView, or an UIPageViewController. Both will work, but the custom scroll view may be a bit simpler.
I tryed to use answer it this quiestion Limiting the scrollable area in UIScrollView however i didnt succeed in my problem.
I have a UIScrollView that contains 3 UIView one after another. When I press on the UIView I add a UITableView under UIView i pressed. At this moment I need to limit scrolling area, so I could scroll only this TableView and UIView.At another press on UIView I hide the UITableView and I can scroll further in horizontal direction. My question is - how its possible to implement scrolling only in that area I described? Only thing I know is I have to change contentSize of my UISCrollView, but when I do it I get to the beginning of UIScrollView.