How to identify the center position of the layout

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

How to identify the center position of the layout

Postby T.Vimal Balan » Sat Jan 30, 2010 8:40 am

Hello i am new to the android development and i want to draw circle in linear layout.i want to circle to remain in center even though i change the emulator to horizontal postions.how to acheive it

Besides i want to know how to get the Width and height of linear layout that i used?

when i tried using this

LinearLayout layMain = (LinearLayout)this.findViewById(R.id.chart);
layMain.addView(new Ball(this));
width=layMain.getWidth();

Log.v("Width",""+width);

I got output as 0,i dont know what's problem,need an idea on this


Regards
T.VimalBalan
T.Vimal Balan
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Jan 30, 2010 8:34 am

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests