Hasmukh
Hasmukh

Reputation: 4670

How to split screen like ipad in android?

i want to make application in android Tablets like in ipad which have spliting screen,

How i can do that ? if any body have idea please send me!

Thank you in advance.

Upvotes: 1

Views: 1205

Answers (5)

Arindam Mukherjee
Arindam Mukherjee

Reputation: 2285

This will be the fragment xml file. then you have to write two xml files for CustomerList(Left Part) and CustomerInfo(Right Part). your activity should extends FragmentActivity. try with this:::

<fragment class="ui.misc.Customers$CustomerList" 
android:id="@+id/customerlistfragmant" android:layout_weight="1" 
android:layout_width="550px" 
android:layout_height="wrap_content" 
/> 
<fragment class="ui.misc.Customers$CustomerInfo" 
android:id="@+id/customerinfofragmant" android:layout_weight="1" 
android:layout_width="350px" android:layout_height="wrap_content" /> 
<FrameLayout android:id="@+id/regscreentwo" android:layout_weight="1" 
android:layout_width="0px" 
android:layout_height="fill_parent" 
/> 
</LinearLayout>

Upvotes: 1

Nermeen
Nermeen

Reputation: 15973

Using fragments: check http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/
it's a tutorial with sample application that uses the compatibility package (allows you to support from API 4), it may help

Upvotes: 2

ScouseChris
ScouseChris

Reputation: 4397

you can use the APIs described here: Fragments API

Upvotes: 0

Vinay W
Vinay W

Reputation: 10190

this is not a 'feature' limited to iOS you can easily do this in Android by using two vertical LinearLayouts and assigning them equal weight - to split the screen into half or Different weights to achieve something like the image you provided.

And of course, there are a lot of other ways to do that.

Upvotes: 1

Egor
Egor

Reputation: 40203

This is achievable using the Fragments API. Fragments are available since Android 3.0, but there's also a Support Library that lets you use these API's from Android 1.6. Hope this helps.

Upvotes: 4

Related Questions