I want to create the application which have the design in image below. how to create the design as shown in image. I have no idea about dividing tablet screen in such a way.
Asked
Active
Viewed 1,323 times
0
-
1you can use 3 fragment in 1 LinearLayout by sumWeight. check this [link](https://stackoverflow.com/a/26605161/4797289) – Rasoul Miri Jul 11 '17 at 10:33
3 Answers
1
Why don't you try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="match_parent"
tools:context=".MainActivity">
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#ff00"
/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#000000"
/>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#009dff"
/>
add anything in 3 fragments and then replace frame layouts with them using.
getSupportFragmentManager().beginTransaction().replace(R.layout.layout_name, new Fragment_name());

Ashutosh Sagar
- 981
- 8
- 20
1
If you want to use your application on several screen sizes, you will have to go through the fragments.
- In landscape and big screen, your layout contains 3 fragments : menu, list and description.
- In portrait, your layout contains 2 fragments, menu in drawer and an other which can be list or description
You can manage these different layouts with the resources, and FragmentManager to dynamically change list and description.
If you want only for tablets, the simple solution is to divide your view in 3 without fragment, but I do not advise this method because you will not be able to easily evolve your application

J-Jamet
- 847
- 8
- 17