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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:38:25+00:00 2026-06-02T18:38:25+00:00

In my android application I have two buttons, situated on a row and above

  • 0

In my android application I have two buttons, situated on a row and above them, is displayed a map. I want each button to occupy half of row. Can anyone tell me how to do that?

Currently my code is:

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/btnProgram"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="Program" />

    <Button
        android:id="@+id/btnAfisareStatii"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="Afisaza toate statiile" 
        android:layout_toRightOf="@+id/btnProgram"/>

    <WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/btnAfisareStatii" />

    <WebView
        android:id="@+id/webview2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/webview" />

    <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="0ws8opHdf-pIbZUa916nju81kSSlPRK4Wbg_0vg"
        android:clickable="true"
        android:enabled="true" 
        android:layout_above="@id/btnProgram">
    </com.google.android.maps.MapView>

</RelativeLayout>
  • 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-02T18:38:26+00:00Added an answer on June 2, 2026 at 6:38 pm

    Use a linear layout and layout_weight:

     <?xml version="1.0" encoding="UTF-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/RelativeLayout1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <LinearLayout
            android:id="@+id/button_container"
            android:layout_alignParentBottom="true"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:layout_height="wrap_content" >
    
            <Button
                android:id="@+id/btnProgram"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:text="Program" />
    
            <Button
                android:id="@+id/btnAfisareStatii"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/btnProgram"
                android:text="Afisaza toate statiile" />
        </LinearLayout>
    
        <WebView
            android:id="@+id/webview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/btnAfisareStatii" />
    
        <WebView
            android:id="@+id/webview2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/webview" />
    
        <com.google.android.maps.MapView
            android:id="@+id/mapView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@+id/button_container"
            android:apiKey="0ws8opHdf-pIbZUa916nju81kSSlPRK4Wbg_0vg"
            android:clickable="true"
            android:enabled="true" >
        </com.google.android.maps.MapView>
    
    </RelativeLayout>
    

    But why are you putting the webviews below the buttons which themselves are aligned to the bottom of the screen?

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

Sidebar

Related Questions

I have two activities in an android application, each has a button that goes
How do I design an android application with two buttons next to each other
I have two buttons within my Android application. It currently shows the two buttons
I want to create two new custom buttons to use in my android application.
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
In my application screen, i have two buttons. one is Activate and another is
I have developed an android application in which some OK button (soft key) is
What I want to do is have two 'frames'. Left and Right. At application
I have a LinearLayout in my android application. Worked well with just the two
I am developing my first Android application. I have created a relativelayout with two

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.