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

  • Home
  • SEARCH
  • 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 8471527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:49:13+00:00 2026-06-10T16:49:13+00:00

I am developing a application i am trying to assign image buttons properly but

  • 0

I am developing a application i am trying to assign image buttons properly but depending on screen they are changing i have added images of low density,high density and midium density images in low high and midium drawable folders.

here is my code and screen shot.

<?xml version="1.0" encoding="utf-8"?>
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    
android:id="@+id/ScrollView01" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content">    
  <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1" 
    android:gravity="center"
    android:paddingLeft="20dip" 
    android:paddingRight="20dip" >

<TableRow>       
<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
  <ImageButton 
       android:id="@+id/aboutus"
       android:scaleType="fitCenter"
       android:src="@drawable/aboutus"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:padding="2dp"
       android:background="@android:color/transparent"
       />
    <TextView
    android:text="About Us"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" 
    android:textColor="#ffffff" />
</LinearLayout>
   <LinearLayout 
   android:orientation="vertical" 
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   >
   <ImageButton
       android:id="@+id/services"         
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="@android:color/transparent"
       android:padding="2dp"
       android:src="@drawable/services123" />
    <TextView
    android:text="Services"
     android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" android:textColor="#ffffff" />
    </LinearLayout>
  </TableRow>    
    <TableRow>
        <LinearLayout android:orientation="vertical" android:layout_width="fill_parent"
       android:layout_height="fill_parent">
    <ImageButton 
       android:id="@+id/courses"           
       android:src="@drawable/services"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:padding="2dp"
       android:background="@android:color/transparent"
       />
    <TextView
    android:text="Courses"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" android:textColor="#ffffff" />
</LinearLayout>
   <LinearLayout 
   android:orientation="vertical" 
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">     
    <ImageButton 
       android:id="@+id/contactus"
       android:src="@drawable/services"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:padding="2dp"
       android:background="@android:color/transparent"
       />
       <TextView
    android:text="contact us"
     android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" android:textColor="#ffffff" />
   </LinearLayout>
 </TableRow>
      <TableRow>
         <LinearLayout android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">
    <ImageButton 
       android:id="@+id/syllabus"
       android:src="@drawable/services"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:padding="2dp"
       android:background="@android:color/transparent"
       />
    <TextView
    android:text="Syllabus"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" 
    android:textColor="#ffffff" />
</LinearLayout>
   <LinearLayout 
   android:orientation="vertical" 
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">          
    <ImageButton 
       android:id="@+id/pingtoupdates"
       android:src="@drawable/services"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:padding="2dp"
       android:background="@android:color/transparent"
       />
    <TextView
    android:text="Ping To Updates"
     android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:padding="3dip" android:textColor="#ffffff" />
    </LinearLayout>
  </TableRow>
 </TableLayout>

enter image description here

  • 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-10T16:49:14+00:00Added an answer on June 10, 2026 at 4:49 pm

    There are two much of variations in layout_width and height from one table row item to the other. In some LinearLayout you have used fill_parent,fill_parent and in some wrap_content, wrap_content. First you need to correct this as you’r requirement says that each row items should be of same dimensions.

    For you case better approach would be to use a GridView. You just need to create one layout file(XML) for the row item and then you can use this for all the row items.
    Here is a sample code for grid item:

     <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
            <ImageButton 
               android:id="@+id/aboutus"
               android:src="@drawable/aboutus"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:padding="2dp"
               android:background="@android:color/transparent"/>
            <TextView
               android:text="About Us"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:gravity="right"
               android:padding="3dip" 
               android:textColor="#ffffff" />
    </LinearLayout>
    

    If you are new to GridView follow this link

    After you are done with this then you should try multiple device support.
    You can follow this link for multiple device support.

    You can also have a look at this stackoverflow post.

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

Sidebar

Related Questions

I'm trying to use UTF-8 encoding for the Spring application I'm developing but I
I am developing an application and trying to use an peer-to-peer communication. i have
I'm developing an application with Grails. Im trying to implement an SSO-functionality. But I
I have been developing GWT application for a while and I'm trying to port
I'm developing an application in javaME and I'm trying to receive incoming sms but
hi im developing silverlight application but when i m trying to compile that file
I'm developing an application with BLE and am trying to constantly scan every known
I am developing an application for iOS 5 . I am trying to push
I am developing a Facebook application, and I am trying to publish the users'
I am developing a small application on Google's android emulator. I am trying to

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.