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
widget.

Thanks

On Nov 18, 3:26pm, Nithin <nithin.war...@gmail.com> wrote:

--



How to put Margin for widgets

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


 i,

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

I got the input from this link

http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/MenuInflateFromXml.html

the code I am working is,

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


Thanks


On Nov 19, 10:42am, Nithin <nithin.war...@gmail.com> wrote:

--


Sponsored Links


Other Threads

1. API to disable/enable data connections

Hi all,

I'm looking for an API to disable/enable data connections(GPRS,EGDE
etc.).
It appears that there is none to be found.
(in the 0.9 version there was something called setRadio but now it is
gone)

Do you know whether things get better in eclair?

I intend to look at the configuration app source code for cupcake.
Did someone try that?

I would be happy to hear from the google guys about their decision.
What are the chances for it to change in the future?

Thanks in advance,
Brownie (one day, my nick will collide with an android version :))

-- 

2. Getting notified of installs

Any more info on this?

Thanks
S




-- 

3. How to add a dialog in a AppWidget

4. Android WVGA support

5. question on media.audio_policy

6. Trap in TabHost when AsyncTask delays setContentView at activity startup

7. How to Help on traduction?