offsetLeftAndRight() not working, TextView not moving..

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

offsetLeftAndRight() not working, TextView not moving..

Postby nithin.warier » Thu Nov 12, 2009 8:37 am

Hi,

I created textview in java and trying offsetLeftAndRight(int), but
the textview is not moving at all. I am using linear layout.

the code is,

layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
TevtView tv = new TextView(this);
tv.offsetLeftAndRight(50);

but the textview is not moving either horizontally or vertically..

Any idea please..

Thanks
Nithin
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Re: offsetLeftAndRight() not working, TextView not moving..

Postby Bosicc » Thu Nov 12, 2009 10:56 am

nithin.warier wrote:but the textview is not moving either horizontally or vertically..


May be your width of LinearLayout set to "wrap_content" and text cannot move inside your Layout. Try to set width="fill_parent" or width="100dp"
User avatar
Bosicc
Freshman
Freshman
 
Posts: 7
Joined: Wed Sep 09, 2009 4:08 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests