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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:15:12+00:00 2026-05-20T08:15:12+00:00

I’m new to Android and am trying to understand how to get a particular

  • 0

I’m new to Android and am trying to understand how to get a particular layout right? Can anyone explain Which layout does Venmo use for their first screen of the Android app (left most image at the following link: http://30.media.tumblr.com/tumblr_lak5yachMv1qcl8xuo1_500.png)

I tried to create a layout similar to that for learning purposes but can’t get it right. Here is my sample layout code:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http``://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:id="@+id/tableLayout1" 
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#fff"
android:scrollbars="none">
<TableRow 
    android:layout_height="wrap_content" 
    android:id="@+id/tableRow1">
    <ImageButton 
        android:layout_height="wrap_content" 
        android:id="@+id/imageButton5" 
        android:background="@drawable/icon" 
        android:layout_width="wrap_content"
        android:layout_weight="1">
    </ImageButton>
</TableRow>    
<TableRow 
    android:layout_height="wrap_content" 
    android:id="@+id/tableRow2">
        <TextView 
            android:text="TextView" 
            android:id="@+id/textView1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:layout_weight="1">
        </TextView>
</TableRow>
<TableRow 
    android:id="@+id/tableRow3" 
    android:layout_height="wrap_content"
    android:layout_margin="0dip"
    android:padding="0px"
    android:background="#ff6600">
        <ImageButton 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:id="@+id/imageButton1" 
            android:background="@drawable/icon"
            android:gravity="left"
            android:layout_weight="1">
        </ImageButton>
        <ImageButton 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/imageButton2" 
            android:background="@drawable/icon"
            android:gravity="right"
            android:layout_weight="1">
        </ImageButton>
</TableRow>
<TableRow 
    android:id="@+id/tableRow4" 
    android:layout_height="wrap_content">
        <ImageButton 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/imageButton3" 
            android:background="@drawable/icon"
            android:gravity="left"
            android:layout_weight="1">
        </ImageButton>
        <ImageButton 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/imageButton4" 
            android:background="@drawable/icon"
            android:gravity="right"
            android:layout_weight="1">
        </ImageButton>
</TableRow>
</TableLayout>

What I’m trying to figure out:

  1. How to scale an ImageButton to 50% of the screen width and height
  2. how to have a flexible height of the ImageButton
  3. How to get rid of the margin or padding on the edges such that the ImageButton’s stick to the wall and each other.
  4. Is a TableLayout a good approach for this layout?
  5. Are there any guidelines for creating images for ImageButton?

Thank you for your 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-20T08:15:13+00:00Added an answer on May 20, 2026 at 8:15 am

    I’m the developer of the Venmo Android app.

    The other answer suggests using a GridLayout which might work better, but the Venmo app is actually using a table layout.

    Here are answers to each individual question…

    1. To get your images to scale to equal width, you need to give them a layout_width of 0dp and then set android:layout_weight to 1.
    2. To get equal heights, set the ImageButton’s layout_height to fill parent, and then set each table row’s weight to 1.
    3. I’m not entirely sure of what margin or padding you’re running into. If you size the ImageButtons and TableRows like I mentioned above this shouldn’t be an issue.
    4. I’m not sure about this one. GridLayout might work better, but I haven’t run into any issues with using TableLayout.
    5. There aren’t any official guidelines, but I suggest creating states for your drawables so the user can tell when they are pressing the button.

    Here’s some sample code of how the Venmo app creates the grid:

    <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
    
    <TableRow android:layout_weight="1">
    
        <ImageButton android:layout_width="0dp"
            android:layout_weight="1" 
            android:layout_height="fill_parent" 
            android:src="@drawable/top_left"
            android:layout_marginRight="2sp"
            android:layout_marginBottom="2sp"
            android:background="@drawable/button"/>             
    
        <ImageButton android:layout_width="0dp"
            android:layout_weight="1" 
            android:layout_height="fill_parent"
            android:src="@drawable/top_right"
            android:layout_marginBottom="2sp"
            android:background="@drawable/button"/> 
    
    </TableRow>
    
    <TableRow android:layout_weight="1">
    
        <ImageButton android:layout_width="0dp"
            android:layout_weight="1" 
            android:layout_height="fill_parent" 
            android:src="@drawable/bottom_left"
            android:layout_marginRight="2sp"
            android:background="@drawable/button"/>
    
        <ImageButton android:layout_width="0dp"
            android:layout_weight="1" 
            android:layout_height="fill_parent" 
            android:src="@drawable/bottom_right"
            android:background="@drawable/button"/>
    
    </TableRow></TableLayout>
    

    Keep in mind that if the screen is ever physically smaller than your ImageButton’s drawable you’re going to run into issues. Also, if you do this you’ll definitely want to make a separate layout for landscape orientation.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to select an H1 element which is the second-child in its group
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

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.