简体   繁体   中英

Android - custom layout for android widget

I want to customize the standard MediaController layout that comes with android, the way i think to do this is to make a custom MediaController layout and overwrite it in some kind of way so that Android uses my layout instead of the layout that it uses normally

Is there any way you can help me achieve my goal?

  1. create a class extend ViewGroup

  2. Override onMeasure() to measure this view and its child view.

  3. Override onLayout() to layout your child view.

here's a sample code of how to create your own customized layout :

it's very similar to the wrapPanel of WPF/silverlight .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM