Code example for ScrollView

Methods: addViewsetFillViewport

0
        this.stylizeTitle(textview);
        textview.setText(this.getMenuData().getTitle());
        textview.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);
        this.getMenuLayout().addView(textview);
         
        container=new ScrollView(this.getApplicationContext());
        container.setFillViewport(true);
        container.addView(this.getMenuLayout(),new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
        //container.setBackgroundColor(Color.GRAY);         
         
        this.setContentView(container,new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
         
        this.navigateTo(path);
    } 
     
    /** 
     * Builds the menu using the XML resource that was passed to it. 
     *  
     * @param menu_resource The value of the resource to load. 
     * @param path Array of <code>int</code>s that specify the indices to follow when navigating the data.