change size of controls in a layout

by dillipk » Thu, 22 Apr 2010 03:32:36 GMT

Sponsored Links
  How do I change the size of the controls placed in a layout? (by any

 I tried to change the height of an EditBox ->setHeight(10); doesn't
seem to work.

Thank you,



change size of controls in a layout

by social hub » Thu, 22 Apr 2010 03:46:09 GMT

 did u call requestLayout()
or invalidate()

if that doesnt work try below
textView.getLayoutParams().height = x;
should work


Sponsored Links

change size of controls in a layout

by karteek » Thu, 22 Apr 2010 12:22:01 GMT

 If you declared EditText in xml file you can change by
<EditText android:layout_width="50px"
  where you can use any nuber instead of 50


change size of controls in a layout

by ~ TreKing » Thu, 22 Apr 2010 21:58:49 GMT


You should use "dp" to stay consistent across devices with different
resolutions, unless this is definitely what you want.

TreKing - Chicago transit tracking app for Android-powered devices 


Other Threads

1. OpenGL ES flickering problems - double buffered?

I just read your post. Looks like I hit the same problem about 6 months ago.
I even managed to create a mostly-reproducible test case so that I could
file an issue:

(I can only think that it's some sort of fairness issue with monitors)

<>My solution was in
the same spirit, but actually uses a simple synchronization-free circular
event buffer that instead uses volatiles to guarantee correct execution.


2009/10/5 Robert Green <>


2. Scroll Left and Right

I posted a question that I never got a response to.  I'm starting to
think what I'm trying to do must be impossible. I see a ListView that
allow me to go up and down.   As a consolation prize, is there any way
I can pan left and right even if it can't go up and down at the same
time?  If this isn't possible, then I assume I'll need to find another

See original question below...


- Mitch

From: Mitch
Date: Thu, 1 Oct 2009 22:54:17 -0700 (PDT)
Subject: Spreadsheet View

I've been trying to make a layout that displays something like a mini
spreadsheet that's specialized for my app.  I would like it to have
headers for both rows and columns.  The row header can only pan left
and right.  The column header can only pan up and down.

Hard to explain in words, so I'll try a picture (must be seen in a
fixed pitch font):

Stays| ... T3 T4 T5 ...
Row 3| ... 32 31  7 ...
Row 4| ... 17 21  9 ...

If the user pushes the image up the screen, row 3 goes away and row 5
appears but the header row stays.  If the user pushes the image to
left, column T3 goes away and column T6 appears and the header column

Having the "..." continuation hint would be nice, but is not

I would also like to be able to have more than 1 header row and
(the ones that stay fixed). The info in the upper left quadrant of
spreadsheet would always stay put.

It would be good to have the spreadsheet retain orientation in both
landscape and portrait to allow the user to choose if the rows or
columns would benefit from more display space.

A nice feature would be to let the user resize rows and/or columns.
This would be especially helpful for the fixed headers as display
space is at a premium.

I don't see anything that scrolls right or left nor anything that
would scroll both right/left and up/down as would be needed for the
lower right quadrant so I'm not even sure where to start.

I suspect nothing like this exists as a single view I can simple drop
into my xml, but how would I create such a thing by combining other
views?  Is there some other way through code to do his?

I'm new so simple hints are appreciated.  Thanks in advance.

- Mitch


3. relocating webview cache using softlinks

4. Make different instances of a widget behave different based on their appWidgetId

5. relocating webview cache using softlinks

6. charting

7. Best way to drawing custom Bitmaps?