Guest User

Untitled

a guest
Jan 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class MyTabbedPageRenderer : TabbedPageRenderer
  2. {
  3. private TabLayout tabLayout = null;
  4.  
  5. protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
  6. {
  7. base.OnElementChanged(e);
  8.  
  9. this.tabLayout = (TabLayout)this.GetChildAt(1);
  10.  
  11. var selectPosition = this.tabLayout.SelectedTabPosition;
  12.  
  13. tabLayout.TabMode = TabLayout.ModeScrollable;
  14. tabLayout.TabGravity = TabLayout.GravityFill;
  15.  
  16. Handler h = new Handler();
  17. Action myAction = () =>
  18. {
  19. tabLayout.GetTabAt(selectPosition).Select();
  20. };
  21.  
  22. h.PostDelayed(myAction, 1);
  23. }
  24. }
Add Comment
Please, Sign In to add comment