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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:56:14+00:00 2026-05-16T17:56:14+00:00

Been trying to create a layout similar to the Android Facebook app (top bar

  • 0

Been trying to create a layout similar to the Android Facebook app (top bar with app name and 2 buttons aligned right).

Tried everything 🙁 the closest I got made one of the buttons disappear…

Here is the code: (using relatives on top to create sticky header and footer)

the “Add” button disappears while the “Search” button aligns to the right.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:orientation="vertical">
 <RelativeLayout android:layout_width="fill_parent"
  android:layout_height="50dip" android:id="@+id/top_control_bar">
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
   android:layout_height="fill_parent" android:src="@drawable/top_background">
   <TextView android:layout_width="wrap_content" android:layout_height="20dip" 
    android:text="APP" android:layout_gravity="left|center" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/add_bookmark" />
   <Button android:id="@+id/add_bookmark" android:layout_width="wrap_content"
    android:layout_height="fill_parent" android:text="Add" android:layout_gravity="right|center" android:layout_alignParentRight="true" />
   <Button android:id="@+id/search_bookmark" android:layout_width="wrap_content"
    android:layout_height="fill_parent" android:text="Search" android:layout_gravity="right|center" android:layout_alignParentRight="true"  />
  </RelativeLayout>
 </RelativeLayout>
 <LinearLayout android:id="@+id/bottom_control_bar"
  android:layout_width="fill_parent" android:layout_height="wrap_content"
  android:layout_alignParentBottom="true">
  <Button android:layout_width="wrap_content"
   android:layout_height="fill_parent" android:text="Backup" />
  <Button android:layout_width="wrap_content"
   android:layout_height="fill_parent" android:text="Restore" />
 </LinearLayout>
 <ListView android:id="@android:id/list" android:layout_width="fill_parent"
  android:layout_height="0dip" android:layout_below="@id/top_control_bar"
  android:layout_above="@id/bottom_control_bar"></ListView>
 <TextView android:id="@android:id/empty" android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="No Bookmarks found. You can add one by clicking the star."
  android:layout_below="@id/top_control_bar" android:layout_above="@id/bottom_control_bar" />
</RelativeLayout>

Would appreciate any 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-05-16T17:56:15+00:00Added an answer on May 16, 2026 at 5:56 pm

    The button is there but BEHIND the search button. If you switch the order of the add and search button, you’ll see that both buttons are there. Both share the same right border coordinate. Use layout_toLeftOf or layout_toRightOf as you did with the “app” TextView.

    You can replace your inner RelativeLayout with the following code.

    
    <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
       <TextView android:layout_width="wrap_content" android:layout_height="20dip" 
        android:text="APP" android:layout_gravity="left|center" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/add_bookmark" />
       <Button android:id="@+id/search_bookmark" android:layout_width="wrap_content"
        android:layout_height="fill_parent" android:text="Search" android:layout_gravity="right|center" android:layout_alignParentRight="true" />
       <Button android:id="@+id/add_bookmark" android:layout_width="wrap_content"
        android:layout_height="fill_parent" android:text="Add" android:layout_gravity="right|center" android:layout_toLeftOf="@id/search_bookmark" />
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've been trying to create a map-related android app, but i realized that the
I've been trying to create what I think is a relatively simple layout for
I'm trying to create a RadioGroup within an Android layout where the child RadioButton
I've been trying to create a layout like this: Now I'm not asking for
I've been trying to create a simple layout. It's a 3x3 grid with a
I am trying to create a calculator app and I've been having problems with
i have been trying to create an xml file that integrates a relative layout
I've been trying for days now to create an application client server,both on android,running
I've got an example layout that I'm trying to create in android using xml.
I am trying to create a small Android App. The app will have four

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.