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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:05:48+00:00 2026-05-26T02:05:48+00:00

I’m developing a Sudoku Game and am having problems with textViews’ heights. As in

  • 0

I’m developing a Sudoku Game and am having problems with textViews’ heights. As in any Sudoku, the user has the option to enter a digit or put some hints. Digits work fine with Fontsize 14, but when I change the hint font size to 7 (dip or sp), the textView height is increased although there is a lot of space around (the same for font size 6 and even with 1 line of text). How do I fix the textView height regardless of the textsize.

Here is the layout portion:

    <TableLayout android:id="@+id/tableLayout1"
    android:layout_marginTop="5dip" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:layout_width="wrap_content">
    <TableRow android:layout_width="wrap_content" android:id="@+id/TableRow01" android:layout_height="wrap_content">
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV00" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:digits="@string/inpt" android:width="30dip" android:text="2"
            android:drawableTop="@drawable/line_h" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV01" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:text="2" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV02" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV03" android:paddingLeft="1dip" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:digits="@string/inpt" android:width="30dip" android:text="2"
            android:drawableTop="@drawable/line_h" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV04" android:clickable="true"
            android:height="34dip" android:layout_height="fill_parent"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:text="2" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV05" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV06" android:paddingLeft="1dip" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:digits="@string/inpt" android:width="30dip" android:text="2"
            android:drawableTop="@drawable/line_h" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV07" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip"></TextView>
        <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
            android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
            android:width="34dip" android:drawableTop="@drawable/line_h"
            android:drawableLeft="@drawable/line_v" android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV08" android:clickable="true"
            android:layout_height="fill_parent" android:height="34dip" android:text="1 2 3"></TextView>
    </TableRow>
    <TableRow android:layout_width="wrap_content" android:id="@+id/TableRow02"
        android:layout_height="wrap_content">
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="32dip" android:text="1"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV10" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:digits="@string/inpt" android:width="30dip"
            android:text="2" android:gravity="center" android:layout_width="fill_parent"
            android:textColor="@android:color/black" android:id="@+id/TV11"
            android:clickable="true" android:layout_height="fill_parent"
            android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="32dip" android:text="2"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV12" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="32dip" android:text="1"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV13" android:paddingLeft="1dip" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:digits="@string/inpt" android:width="30dip"
            android:text="2" android:gravity="center" android:layout_width="fill_parent"
            android:textColor="@android:color/black" android:id="@+id/TV14"
            android:clickable="true" android:layout_height="fill_parent"
            android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="34dip" android:text="2"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV15" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="34dip" android:text="1"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV16" android:paddingLeft="1dip" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:digits="@string/inpt" android:width="30dip"
            android:text="2" android:gravity="center" android:layout_width="fill_parent"
            android:textColor="@android:color/black" android:id="@+id/TV17"
            android:clickable="true" android:layout_height="fill_parent"
            android:height="32dip"></TextView>
        <TextView android:typeface="monospace" android:drawableRight="@drawable/line_v"
            android:digits="@string/inpt" android:width="34dip" android:text="2"
            android:drawableLeft="@drawable/line_v" android:gravity="center"
            android:layout_width="fill_parent" android:textColor="@android:color/black"
            android:id="@+id/TV18" android:clickable="true"
            android:layout_height="fill_parent" android:height="32dip"></TextView>
    </TableRow>
  • 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-26T02:05:49+00:00Added an answer on May 26, 2026 at 2:05 am

    I found a solution to my question without the need to redo my code & design with gridview (thanks slayton for your suggestion, but I found an easier workaround).

    I don’t completely understand why but after playing around with the textviews’ properties, I found that when I change the textsize of one textview to 7 (or any other value actually) I need to change its layoutheight to Fill_Parent (but keep all textViews in the row with size 14 with layoutheight Wrap_Content). I do this programmatically. The new layout is

        <TableLayout android:id="@+id/tableLayout1"
        android:layout_marginTop="5dip" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:layout_width="wrap_content">
        <TableRow android:layout_width="fill_parent" android:id="@+id/TableRow01" android:layout_height="wrap_content">
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV00" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:digits="@string/inpt" android:width="30dip" android:text="2"
                android:drawableTop="@drawable/line_h" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV01" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:text="2" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV02" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV03" android:paddingLeft="1dip" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:digits="@string/inpt" android:width="30dip" android:text="2"
                android:drawableTop="@drawable/line_h" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV04" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:text="2" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:gravity="center"
                android:layout_width="fill_parent" android:textColor="@android:color/black"
                android:id="@+id/TV05" android:clickable="true"
                android:height="34dip" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:text="1" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:gravity="center"
                android:textColor="@android:color/black"
                android:id="@+id/TV06" android:paddingLeft="1dip" android:clickable="true"
                android:height="34dip" android:layout_width="fill_parent" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:digits="@string/inpt" android:width="30dip" android:drawableTop="@drawable/line_h" android:textColor="@android:color/black"
                android:id="@+id/TV07" android:clickable="true"
                android:height="34dip" android:layout_width="fill_parent" android:maxHeight="34dip" android:maxWidth="30dip" android:gravity="center" android:text="2" android:layout_height="wrap_content"></TextView>
            <TextView android:typeface="monospace" android:drawableBottom="@drawable/line_h"
                android:drawableRight="@drawable/line_v" android:digits="@string/inpt"
                android:width="34dip" android:drawableTop="@drawable/line_h"
                android:drawableLeft="@drawable/line_v" android:textColor="@android:color/black"
                android:id="@+id/TV08" android:clickable="true"
                android:height="34dip" android:maxHeight="34dip" android:layout_width="fill_parent" android:gravity="center" android:text="2" android:layout_height="wrap_content"></TextView>
        </TableRow>
    

    And I use code to change the size & the layoutheight together:

        tv.setTextSize(7);
    tv.setLayoutParams(new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    
    
        tv.setTextSize(14);
    tv.setLayoutParams(new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); 
    
    • 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'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.