简体   繁体   中英

How to use layout bigger than tablet screen

I'm creating an app which I will use a layout like this

图像布局 1

Black - Tablet Screen | Purple - Menu | Light Blue - ListView 1 | Blue - Content | Red - ListView 2

And after I choose an option from Listview 1, my layout needs to be like this another image

图像布局 2

Black - Tablet Screen | Purple - Menu | Light Blue - ListView 1 | Blue - Content | Red - ListView 2

So, how I create my layout bigger than tablet screen (using XML) and just do something that will hide/show Listview 1 or Listview 2 to work using any tablet?

Thanks and regards!

  1. Include both ListView in your XML (I'll assume you use left_list and right_list for IDs), preferably in a LinearLayout with your content view and the content view has layout_weight="1"
  2. Add android:visibility='gone' to your XML for right_list
  3. Ensure you have a reference to left_list and right_list in your Activity (I'll assume these are leftList and rightList
  4. When clicking a list item, call leftList.setVisibility(View.GONE); rightList.setVisibility(View.VISIBLE) leftList.setVisibility(View.GONE); rightList.setVisibility(View.VISIBLE) to trigger the visibility to change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM