Question about Button and SurfaceView

by Karthik Ravi Shankar » Fri, 23 Apr 2010 16:23:56 GMT


Sponsored Links
 Hi,

I am trying to use SurfaceView for an app. But I need to add buttons the
canvas as well. Not able to gather much from Android.developer site. Can
anybody post if they have done it or have some ideas ?

Thanks,
Karthik R
Graduate Student
Computer Science Department
UCLA

--



Question about Button and SurfaceView

by Mark Murphy » Fri, 23 Apr 2010 19:33:21 GMT


 


Step #1: Define a RelativeLayout.

Step #2: Put the SurfaceView as a child of the RelativeLayout.

Step #3: Put the Button as a *later* child of the RelativeLayout.

This will cause the Button to appear to "float" on the SurfaceView. See
this project for an example:

 http://github.com/commonsguy/vidtry 

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

--


Sponsored Links


Other Threads

1. Interface Inconsistency

I'm not entirely certain whether it's android or HTC Sense but one
thing I find that is wrong with my android phone is that to dismiss a
call I have to flick the screen upwards.  However to dismiss an
Outlook calendar event I have to flick it downwards.

Only a minor niggle but when multitasking I find it a distraction!

-- 
.

2. Voice SMS

Mau kirim sms pk voice bahasa indonesia lom bs atau sy lom tagu caranya ya ?
Soalnya kl search dah bs kan tuh.

Ada yg dah pernah coba atau tau infonya ?

TIA

Rgds,
Petra Immanuel

-- 
===============

3. Color Picker Preference

4. Article Not Listed in "Articles" Menu

5. Android 3.0 presentation on Slideshare

6. emulator running abnormally slow

7. receive intent ACTION_MAIN