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 8546999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:09:57+00:00 2026-06-11T13:09:57+00:00

In my application I have created a Relative layout containing 5 buttons and now

  • 0

In my application I have created a Relative layout containing 5 buttons and now I want to use the same layout in other layouts as a background. I am trying the code android:background+"@layout/dashboard" but eclipse is showing me an error. I want to show that layout as Parent Bottom so that I can implement a scroll view and can call all the elements except the dashboard. Please help me in letting me know that:

  1. How can I add another layout as a background
  2. How can I set that layout to alignParentBottom
  3. how can I modify the scrollView so that dashboard stays static and the rest of the elements can scroll..

Code for dashboard.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/b1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:text="Home" />

    <Button
        android:id="@+id/b2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/b1"
        android:layout_alignParentBottom="true"
        android:text="Explore" />

    <Button
        android:id="@+id/b3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:text="MIC" />

    <Button
        android:id="@+id/b4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/b5"
        android:layout_alignParentBottom="true"
        android:text="Msngr" />

    <Button
        android:id="@+id/b5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:text="Profile" />

</RelativeLayout>

Code for showdashboard.xml

<?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:background="@layout/dashboard" >

</LinearLayout>

The Error that I am Getting is:

Failed to parse file C:\Users\%username%\Documents\eclipse\CustomList\res\layout\dashboard.xml
Exception details are logged in Window > Show View > Error Log

Please help..

  • 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-11T13:09:59+00:00Added an answer on June 11, 2026 at 1:09 pm

    Since you would like a static view pf buttons at the bottom of the page, you can wrap those buttons in a linear layout and the put the rest inside a scroll view.

    <?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="vertical"
    android:weightSum="1" >
    
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.7"
        android:id="@+id/s_view" >
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >
    
            <!-- You can put your components here -->
        </LinearLayout>
    </ScrollView>
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.3"
        android:orientation="horizontal" >
    
        <!-- your 5 buttons here -->
        <Button
            android:layout_width="match_parent"
            android:layout_height="20dp" />
        <Button
            android:layout_width="match_parent"
            android:layout_height="20dp" />
        <Button
            android:layout_width="match_parent"
            android:layout_height="20dp" />
        <Button
            android:layout_width="match_parent"
            android:layout_height="20dp" />
        <Button
            android:layout_width="match_parent"
            android:layout_height="20dp" />
    </LinearLayout>
    

    you can change the size of bottom layout/scrollview by adjusting the layout weights.

    If you want to use the same layout for more than one activity, then make separate linear layouts (or others if you prefer) and then you can add them to the scrollView in your activities.

    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_layout);
        ScrollView sv = (ScrollView) findViewById(R.id.s_view);
        LayoutInflater lInflator = getLayoutInflater();
        sv.addView(lInflator.inflate(R.layout.view_component, null));
    
    }
    

    where s_view is the id of the scroll view and the component view is the target layout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created Windows Application. In this, I have multiple tables in dataset, now
I have created a play application and have some models. One of them contains
I have created application where i just need to access data form assets folder.
I have created one Catalyst application and I have created Schema and Model using
I have an application where i have created a thread which must check the
I have an application where I have a Shipment model. I have created a
I have created an application in windows form. Once I submit the application, the
I have created an application that connect on a web-server and reads an xml
I have created an application in facebook,all is working fine except the publish to
I have created an application using Adobe Flex. I took all the files from

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.