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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:52:26+00:00 2026-06-15T05:52:26+00:00

I’m getting a little frustrated with the Layout support in ADT and Eclipse. It’s

  • 0

I’m getting a little frustrated with the Layout support in ADT and Eclipse. It’s Swing all over again. Basically I’m trying to implement a simple layout like so:
RelativeLayout

+----------------+
|                |
| FrameLayout    |
|    ImageView   |
|                |
|                |
|                |
+----------------+
| LinearLayout   |
|    TextView    |
|    Buttons     |
+----------------+

The RelativeLayout and FrameLayout are used with the ImageView for some pan/zoom listener support I wrote.

The problem I’m having is the LinearLayout (bottom controls) won’t say at the bottom of the window no matter what I try. I’ll simply paste what I’ve got below. Note that the FieldView is an extension of an ImageView. The image displays fine, its the LinearLayout that wants to be displayed on top of the FrameLayout that’s in the way.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fieldcontainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:baselineAligned="false"
    android:orientation="vertical" >

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <com.test.FieldView
            android:id="@+id/field"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </FrameLayout>

    <LinearLayout
        android:id="@+id/controls"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/buttonAddNode"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Add node" />

        <TextView
            android:id="@+id/textViewNodeInfo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TextView" />
    </LinearLayout>

</RelativeLayout>

Thanks in advance for any advice. Maybe I misused a RelativeLayout parameter in my previous tries.

UPDATE
Thanks for the fast response! I couldn’t comment with code below, so here’s an update I’ve tried:

<FrameLayout
    ...
    android:layout_above="@+id/controls">

;previously and I get the following exception at runtime:

Unable to start activity ComponentInfo{com.test.MainActivity}:
    java.lang.ClassCastException: android.widget.LinearLayout

The line throwing the exception is in my MainActivity.OnCreate():

view = (FieldView) findViewById(R.id.field);

It looks like adding layout_below caused an ID mismatch? Finding R.id.field is returning the ID for the wrong LinearLayout, which I naturally can’t cast.

Note that without the layout_above, this works without any problem, just a broken layout. Again, FieldView is just an extension of an ImageView. I store my touch listeners and some other stuff in there.

  • 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-15T05:52:27+00:00Added an answer on June 15, 2026 at 5:52 am

    You simply wrap it all in a relative layout and anchor the linear layout to the bottom using. android:layout_alignParentBottom="true"

    To keep the controls from being over-run by the stuff above it, lay them out above using android:layout_above="@id/controls".

    LIke so:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/fieldcontainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:baselineAligned="false" >
        <!-- Your other stuff -->
    
        <LinearLayout
            android:id="@+id/controls"
            android:layout_width="match_parent"
            android:layout_height="wrap_contgnt"
            android:orientation="horizontal"
            android:layout_alignParentBottom="true">
        <!-- Your control stuff -->
        </linearlayout>
    </relativelayout>
    

    Note that you must define an id (@+) before you can simply reference (@) it. So you can either move the controls view to occur in the XML file before anything else, or use “@+” in the location reference that comes first and then just use @ in the view defineintion.

    So you would have android:layout_above="@+id/controls" and then the other line would be android:id="@id/controls".

    And changing your layout would have no effect on the id’s present within it unless you changed them.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.