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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:35:52+00:00 2026-05-27T07:35:52+00:00

I’m writing an Android application. Here is it’s XML layout : <ScrollView android:id=@+id/ScrollView01 android:layout_width=fill_parent

  • 0

I’m writing an Android application. Here is it’s XML layout :

 <ScrollView android:id="@+id/ScrollView01"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"  
        android:layout_gravity="left|top|bottom|right"
        android:layout_marginTop="80dip"
        android:layout_marginLeft="0dip"
        android:layout_marginRight="0dip"
        android:layout_marginBottom="60dip"

>

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/centerlayout"
    android:orientation="vertical"
    android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_gravity="left|right|top|bottom"
        android:layout_marginRight="20dip"
        android:layout_marginLeft="10dip"
        android:layout_marginBottom="120dip"    >

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >



    <TableRow>
         <Button android:text="Button" 
             android:layout_column="0"
            android:id="@+id/bookmarkbutton" 
            android:layout_width="230dip" 
            android:layout_height="30dip" 

            android:background="@drawable/red_btn"
            android:padding="14dp" 
           ></Button>


    </TableRow>


    </TableLayout>

   </LinearLayout>



</ScrollView>

and if I run it, it displays the following screen:
enter image description here

But when I add android:layout_gravity=”left” to the “Button”, the button size decreases and shows :
enter image description here

Please note if I change the width of button by android:layout_width=”30dip”, it shows small buttons,
enter image description here

but If I change it to bigger sizes, it does not apply the size correctly and the max width is the same as second image.

Finally If I add a new textview to it, via

ScrollView android:id="@+id/ScrollView01"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"  
        android:layout_gravity="left|top|bottom|right"
        android:layout_marginTop="80dip"
        android:layout_marginLeft="0dip"
        android:layout_marginRight="0dip"
        android:layout_marginBottom="60dip"



>

         <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/centerlayout"
        android:orientation="vertical"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:layout_gravity="left|right|top|bottom"
        android:layout_marginRight="20dip"
        android:layout_marginLeft="10dip"
        android:layout_marginBottom="120dip"


        >

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >



  <TableRow>
         <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/subjecttext"
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"
        android:lineSpacingExtra="10dip"
        android:padding="14dp" 
        />    
        </TableRow>

    <TableRow>
         <Button android:text="Button" 
             android:layout_column="0"
            android:id="@+id/bookmarkbutton" 
            android:layout_width="20dip" 
            android:layout_height="30dip" 
            android:background="@drawable/black_btn"
            android:padding="14dp" 
           ></Button>


    </TableRow>





</TableLayout>

        </LinearLayout>



        </ScrollView>

It displays the following image, and the size of button no longer is changeable. Would you please tell me what’s wrong?

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-05-27T07:35:53+00:00Added an answer on May 27, 2026 at 7:35 am

    Try to use LinearLayout instead of TableLayout. Here your code with LinearLayout:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/ScrollView01" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:layout_gravity="left|top|bottom|right" 
        android:layout_marginTop="80dip" 
        android:layout_marginLeft="0dip" 
        android:layout_marginRight="0dip"
        android:layout_marginBottom="60dip">
        <LinearLayout android:id="@+id/centerlayout" 
                    android:orientation="vertical" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent"
                    android:layout_gravity="left|right|top|bottom" 
                    android:layout_marginRight="20dip" 
                    android:layout_marginLeft="10dip" 
                    android:layout_marginBottom="120dip">
            <TextView android:text="Very long text in textview" 
                    android:textSize="20sp" android:id="@+id/subjecttext"
                    android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:lineSpacingExtra="10dip" 
                    android:padding="14dp" />
            <Button android:id="@+id/bookmarkbutton" 
                    android:background="@drawable/red_btn" 
                    android:text="Button" 
                    android:padding="14dp" 
                    android:layout_height="30dip"
                    android:layout_width="20dip">
            </Button>
        </LinearLayout>
    </ScrollView>
    

    And Screenshot:

    enter image description here

    Hope, it help you!.

    I actually see that your buttons in the button of screen have cropped text. Is this a second problem?

    Bellow I attached screenshot with code:

    enter image description here

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/ScrollView01" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:layout_gravity="left|top|bottom|right" 
        android:layout_marginTop="80dip" 
        android:layout_marginLeft="0dip" 
        android:layout_marginRight="0dip"
        android:layout_marginBottom="60dip">
        <LinearLayout android:id="@+id/centerlayout" 
                    android:orientation="vertical" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent"
                    android:layout_gravity="left|right|top|bottom" 
                    android:layout_marginRight="20dip" 
                    android:layout_marginLeft="10dip" 
                    android:layout_marginBottom="120dip">
            <TextView android:text="Very long text in textview" 
                    android:textSize="20sp" android:id="@+id/subjecttext"
                    android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    android:lineSpacingExtra="10dip" 
                    android:padding="14dp" />
            <Button android:text="Button" 
                    android:background="@drawable/red_btn" 
                    android:id="@+id/button1" 
                    android:layout_width="wrap_content" 
                    android:layout_height="wrap_content"></Button>
        </LinearLayout>
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am writing an app with both english and french support. The app requests
I'm parsing an XML file, the creators of it stuck in a bunch social
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
In my XML file chapters tag has more chapter tag.i need to display chapters
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.