Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9156877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:52:34+00:00 2026-06-17T12:52:34+00:00

i have a layout contains from two sections , the first section (without scroll)

  • 0

i have a layout contains from two sections , the first section (without scroll) is for letters, the second section (with scroll) is for objects, how to put a list view on the second section? and have i make setcontentfiew(R.layout.menu) on the oncreate()?
this is the activity

public class FoodsMenu extends ListActivity {

    String foods[];

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, foods));
    }

}

this is the layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:fillViewport="true" >
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#000000"
            android:orientation="vertical" >
        </LinearLayout>
    </ScrollView>
    <LinearLayout
        android:layout_width="40dp"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:background="#ffffff"
        android:orientation="vertical" >
        <TextView
            android:id="@+id/tvA"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="13dp"
            android:layout_gravity="center"
            android:textColor="#025f7c"
            android:text="A" />
        <TextView
            android:id="@+id/tvB"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="13dp"
            android:layout_gravity="center"
            android:textColor="#025f7c"
            android:text="B" />
        <TextView
            android:id="@+id/tvC"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="13dp"
            android:layout_gravity="center"
            android:textColor="#025f7c"
            android:text="C" />
        <TextView
            android:id="@+id/tvD"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="13dp"
            android:layout_gravity="center"
            android:textColor="#025f7c"
            android:text="D" /> 
    </LinearLayout>
</LinearLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:52:35+00:00Added an answer on June 17, 2026 at 12:52 pm

    The following xml will create a layout with two horizontal sections. The first section will have a vertical LinearLayout with the 5 TextViews and no scroll, while the second section will have a ListView to hold the objects.

    Also note that ListView has it’s own Scroller, so you don’t need to add one yourself.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >
        <LinearLayout
            android:layout_width="40dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:background="#ffffff"
            android:orientation="vertical" >
            <TextView
                android:id="@+id/tvA"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="13dp"
                android:layout_gravity="center"
                android:textColor="#025f7c"
                android:text="A" />
            <TextView
                android:id="@+id/tvB"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="13dp"
                android:layout_gravity="center"
                android:textColor="#025f7c"
                android:text="B" />
            <TextView
                android:id="@+id/tvC"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="13dp"
                android:layout_gravity="center"
                android:textColor="#025f7c"
                android:text="C" />
            <TextView
                android:id="@+id/tvD"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="13dp"
                android:layout_gravity="center"
                android:textColor="#025f7c"
                android:text="D" /> 
        </LinearLayout>
        <ListView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                ...... // other ListView attributes
              >
        </ListView>
    
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a layout that contains two ImageViews. I want one of them to
I have two GridViews layed out side by side. The first GridView contains variable
I have my own control which derives from StackPanel. This control contains two other
I have a simple layout, which contains two fragments. One of the two fragments
I have a simple login layout that contains two EditText fields and a Button
I have a layout defined in XML. It contains also: <RelativeLayout android:id=@+id/item android:layout_width=fill_parent android:layout_height=wrap_content
I have a border layout in ExtJS, The north region contains some HTML, but
Hei, I have a main report with Portrait layout, but the main report contains
For my iPad App, I have a main ViewController which contains two UIScrollviews and
I have two div's without any width as I am working on a fluid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.