|
|
#1 |
|
UIScrollView - position of scroll bars
Is there a way to get the position of the scroll bars in a UIScrollView?
|
|
|
|
0
|
|
|
#2 |
|
Not that I know of.
But the scrollers to screen should be the same relation as the center of the scrollview is to its content. |
|
|
|
0
|
|
|
#3 |
|
There are no scroll bars in a scrollview. I think what you want are contentOffset and setContentOffset:
|
|
|
|
0
|
|
|
#4 |
|
Yes. That's what I want! I'm trying to find this out in the scrollViewDidScroll method in my UIScrollViewDelegate. I did this but point returned is always {0,0}. Do you know what I'm doing wrong? Thanks!
Code:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGPoint point = [scrollView contentOffset];
}
|
|
|
|
0
|
|
|
#5 |
|
Don't know what you're doing wrong. How do you know the value of the point? Probably the x value will always be 0. y should change. This works for me:
Code:
- (void)scrollViewDidScroll:(UIScrollView *)inscrollView
{
CGPoint p = inscrollView.contentOffset;
NSLog(@"x = %f, y = %f", p.x, p.y);
}
Code:
2008-09-22 21:04:16.122 ScrollViewTest[29247:20b] x = 0.000000, y = 13.000000 2008-09-22 21:04:16.138 ScrollViewTest[29247:20b] x = 0.000000, y = 29.000000 2008-09-22 21:04:16.155 ScrollViewTest[29247:20b] x = 0.000000, y = 47.000000 2008-09-22 21:04:16.172 ScrollViewTest[29247:20b] x = 0.000000, y = 63.000000 |
|
|
|
0
|
|
|
#6 |
|
Ah, Thanks! I was printing the values out using "%d". Works now!
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| scrolling a UIScrollView on the click of a button | ashwinr87 | iPhone/iPad Programming | 2 | Jun 17, 2011 01:00 PM |
| UIScrollView - Showing user more content is available on scroll | ashwinr87 | iPhone/iPad Programming | 4 | May 23, 2011 12:03 PM |
| UIScrollView untouchable as subclass, fine normally | carlosbutler | iPhone/iPad Programming | 1 | Apr 28, 2011 09:49 PM |
| drag images in & out of UIScrollview | BarryK88 | iPhone/iPad Programming | 3 | Mar 23, 2011 05:49 AM |
| scroll a uitextfield and a uitextview in a uiscrollview | franium | iPhone/iPad Programming | 14 | Dec 4, 2010 02:51 AM |
All times are GMT -5. The time now is 11:59 AM.









Linear Mode

