Android:How to add a button in surface view

前端 未结 4 1968
时光取名叫无心
时光取名叫无心 2020-12-04 14:56

I\'m drawing some graphics and i would like to add a couple of buttons to it. But with the surface view how do we add these buttons programatically ?

4条回答
  •  悲哀的现实
    2020-12-04 15:32

    Enclose your surfaceView with a FrameLayout in your xml Layout. Then add your buttons to the same FrameLayout. Make sure they are placed below the surface view so they get drawn on top of it. (Might be a good idea to bundle them in another Layout and add that to the FrameLayout.)

    
        
        
            
            
        
    
    

提交回复
热议问题