I want to show user there is a more content below but UITableView only shows scroll indicator when we scroll the tableview. There is any way, so I can show scroll indicator
- (void)viewWillAppear:(BOOL)animated
{
[self.tableView flashScrollIndicators];
}
This may help you in solving your problem
Here is the piece of code works for me, add this code in viewDidAppear
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.tableView_service.flashScrollIndicators()
}
Happy Coding
-(void)viewDidAppear:(BOOL)animated{
timer = [NSTimer scheduledTimerWithTimeInterval:0.8 target:self selector:@selector(indicator:) userInfo:nil repeats:YES];
}
-(void)viewDidDisappear:(BOOL)animated{
[timer invalidate];
}
-(void)indicator:(BOOL)animated{
[tableViewer flashScrollIndicators];
NSLog(@"asda");
}
Just blink the scrollbar
I did it:) I'm programming in MonoDevelop, so I only describe the method:
You have to make your own UITableView
class.
There you overload PerformSelector
and do NOT call the base function of it,
but call flashScrollIndicators
if the name of the Selector is _notifyPopOverStoppedScrolling
.
Overload function ReloadData
and there call flashScrollIndicators
as well. Only at zooming it will disappear, but you can call flashScrollIndicators
at zooming too.
There's no way (that I know of) to permanently display the scrollbars. You can
[tableView flashScrollIndicators]
in -viewDidAppear:
to shortly display the scrollbars when the view is shown.
Also, if you have many entries, you might wanna consider showing the (alphabetic) section index at the right. To do that, define -sectionIndexTitlesForTableView
in your UITableViewDataSource
. Using tableView.sectionIndexMinimumDisplayRowCount
you can define the minimum number of entries to display the section Index.
I got Solution for this question .
Implement UIImageView
@implementation UIImageView (UIScrollView)
- (void) setAlpha:(float)alpha {
if (self.superview.tag == noDisableVerticalScrollTag) {
if (alpha == 0 && self.autoresizingMask == UIViewAutoresizingFlexibleLeftMargin) {
if (self.frame.size.width <10 && self.frame.size.height > self.frame.size.width) {
UIScrollView *sc = (UIScrollView*)self.superview;
if (sc.frame.size.height < sc.contentSize.height) {
return;
}
}
}
}
if (self.superview.tag == noDisableHorizontalScrollTag) {
if (alpha == 0 && self.autoresizingMask == UIViewAutoresizingFlexibleTopMargin) {
if (self.frame.size.height <10 && self.frame.size.height < self.frame.size.width) {
UIScrollView *sc = (UIScrollView*)self.superview;
if (sc.frame.size.width < sc.contentSize.width) {
return;
}
}
}
}
[super setAlpha:alpha];
}
@end
And Set tag Tableview or Scrollview Like
#define noDisableVerticalScrollTag 97240626 //for visible only vertical scrollIndicator.
#define noDisableHorizontalScrollTag 9898460 // for visible only Horizontal scrolling.
and for Tableview [tableView flashScrollIndicators];
and scrollview [[scrollobj flashScrollIndicators]];
Thanks .