user6788419
user6788419

Reputation: 7340

UITableView Scroll Indicator in Left Side

I need to bring Scroll indicator to the left side of a table view.

self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 0, self.tableView.bounds.size.width-8); 

Above code is working fine for iPhone 5, 5C etc.

But scroll indicator is not positioned well in iPhone 6. It shows some padding from left side.

Upvotes: 0

Views: 812

Answers (1)

Puneet Sharma
Puneet Sharma

Reputation: 9484

In viewDidLoad method, the bounds of the view are not set correctly and if view is set in nib/storyboard, bounds are set accroding to size of view set there.

I guess, in your nib.storyboard you have chosen iPhone 5S/iPhone 5S size to design the view and henceit works in those devices.

If you set tableView's scrollIndicatorInsets in viewDidLayoutSubviews method, the indicator inset should set correctly.

Upvotes: 2

Related Questions