How to put Margin for widgets

by Nithin » Thu, 19 Nov 2009 13:42:49 GMT

Sponsored Links
 ny idea, how to put margin for widgets...

setPadding() wont work in my case. I want the entire widget to move,
unlike setPadding. In setPadding(), only contents will move within the


On Nov 18, 3:26pm, Nithin <> wrote:


How to put Margin for widgets

by Nithin » Thu, 19 Nov 2009 14:54:24 GMT


I dont know, what I did till now, now all working fine..

I got the input from this link

the code I am working is,

layout = new LinearLayout(this);
layoutParams = new LinearLayout.LayoutParams(
layoutParams.setMargins(30, 10, 0, 0);
TextView tv = new TextView(this);
tv.setText("Sample text");
layout.addView(tv, layoutParams);


On Nov 19, 10:42am, Nithin <> wrote:


Sponsored Links

Other Threads

1. map that open an overlay when a "pin" is clicked and the overlay contains description and button


I like tu use the MapActivity to display some pins. When a pin is
pressed i like to open a description.

This can I obtain following the tutorial:

But now I like to put a button on the overlay window. That button should open
a detail activity. How can I make this?

How is possible to personalize the overlay "info window"?

 _| _.  o _| _
(_| (_| \/ | (_| (/_


2. The onAnimationEnded() event is unreliable

By looking at the code of the ViewGroup class at the function
private void finishAnimatingView(final View view, Animation animation)
it is clear that after the animation ended the view goes through  last
revalidation process.

I suspect that this cause a major bug since we get this event before
the actual animation is ended. The side effect is annoying flickering.

In any case, the question is how to get the real end of animation


3. How to position buttons in a linear layout?

4. Efficient screen updates for games

5. ReferenceTable overflow (max=512)

6. make automatic login on application

7. Can I use the Linux usbserial driver and ADB at the same time?