Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ScrollPane extends RelativeLayout {
- private var _scrollview:ScrollView;
- private var _horizontalScrollView:HorizontalScrollView;
- private var _layout:RelativeLayout;
- public function new(context:Context) {
- super(context);
- _scrollview = new ScrollView(context);
- addView(_scrollview, new RelativeLayout_LayoutParams(ViewGroup_LayoutParams.MATCH_PARENT, ViewGroup_LayoutParams.MATCH_PARENT));
- _horizontalScrollView = new HorizontalScrollView(context);
- _scrollview.addView(_horizontalScrollView);
- _layout = new RelativeLayout(context);
- _horizontalScrollView.addView(_layout, new RelativeLayout_LayoutParams(ViewGroup_LayoutParams.MATCH_PARENT, ViewGroup_LayoutParams.MATCH_PARENT));
- }
- @:overload
- public override function addView(view:View, params:ViewGroup_LayoutParams) {
- if (view == _scrollview) {
- super.addView(view, params);
- } else {
- _layout.addView(view, params);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement