Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 1.05 KB | None | 0 0
  1. class ScrollPane extends RelativeLayout {
  2.     private var _scrollview:ScrollView;
  3.     private var _horizontalScrollView:HorizontalScrollView;
  4.     private var _layout:RelativeLayout;
  5.    
  6.     public function new(context:Context) {
  7.         super(context);
  8.        
  9.         _scrollview = new ScrollView(context);
  10.         addView(_scrollview, new RelativeLayout_LayoutParams(ViewGroup_LayoutParams.MATCH_PARENT, ViewGroup_LayoutParams.MATCH_PARENT));
  11.        
  12.         _horizontalScrollView = new HorizontalScrollView(context);
  13.         _scrollview.addView(_horizontalScrollView);
  14.        
  15.         _layout = new RelativeLayout(context);
  16.         _horizontalScrollView.addView(_layout, new RelativeLayout_LayoutParams(ViewGroup_LayoutParams.MATCH_PARENT, ViewGroup_LayoutParams.MATCH_PARENT));
  17.     }
  18.    
  19.     @:overload
  20.     public override function addView(view:View, params:ViewGroup_LayoutParams) {
  21.         if (view == _scrollview) {
  22.             super.addView(view, params);
  23.         } else {
  24.             _layout.addView(view, params);
  25.         }
  26.     }
  27.    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement