开发者

Create custom styled buttons class like the new Android Market has?

Would it be possible to create a class which you could pass four or so variables into that would create a button that looks similar to the new Android 3.0 Market link buttons? I am trying to learn all aspects of Android design. The button in question is below:

Create custom styled buttons class like the new Android Market has?

I think it would be cool if you could in your code create a new button that looks similar to this by going.

myButton = new myButton(hex value, mainText, subText, image resource);

The hex would determine the color bar, the 开发者_如何学JAVAmainText the Title(Apps), etc.

Is this possible? Thanks...any similar examples would be great


Yup, Create a composite view which exposes all these functionalities.

  • Extend a View class (CustomButton).
  • Create a layout with all these sub-widgets ( 2 textviews + 1 image)
  • Inlfate the layout and add it to your CustomButton
  • Expose methods in your Custombutton class which interact with the sub-widgets (2 TVs + 1 IV)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜