Online Tutorials & Training Materials |
Register Login

Split Screen using Multiple Layout

|| || 0

Split Screen using Multiple Layout

How to Split Screen Layout in Android

Please follow the steps below in order to use split screen layout in Android App:

1.Splitting the screen using multiple layouts in a single activity

2.Start a new project

3.Remove the 'Hello world' text.

4.Click on the text tab.

5.Change Relative layout to Linear layout.

6.Add android: orientation = 'vertical'

7.Go to the Design tab.

8.Go to Layout > relative layout. Drag relative layout under the component tree. Add another relative layout under the component tree.

9.Go to the Text tab. Add a line android:layout_weight='.5'. You can notice the size on the adjoining screen.

To Remove the Action Bar

10.Go to res > values > styles.xml

11.Replace Light.DarkActionBar with NoActionBar.

12.Go to activity.xml, then the Design tab. You will notice that the action bar has disappeared from the screen.

13.Go to Widgets > Button. Drag the button to the center of the screen.

14.Click on the WebView and drag it on the bottom portion of the window.

15.Go the Text tab. Remove the unwanted code highlighted in blue.

16.Replace wrap content with match parent.

Related Articles