My response assumes that you're using a custom Adapter to draw the
buttons. There are two ways.

1. As you may already know, the "getView" method creates the buttons.
You can't style the buttons by ways of the parent activity in the
"onCreate" method like all the docs demonstrate. And if you trying,
you will get a NULL when trying to cast to the Button class (or
subclass). You have to do it within the "getView" method in your
custom Adapter subclass.

2. Make a Button subclass then you'll be able to use in your layout
resource files with attributes. Note: make sure you overload the
constructor Button(Context,AttributeSet) otherwise you won't be able
to set any attributes in the XML file for that view.

Hopes this helps

Jurnell

On Jul 26, 3:27 am, Joakim Carlgren <[email protected]> wrote:
> Here is my problem
>
> Mygridviewis populated with Buttons. TheGridViewitself is
> accessible through my activity's layout file so I can add a style to
> it however adding a style to its child views, in this case buttons,
> seems impossible for some reason.
>
> does anyone know how to go about this?
>
> thanks
>
> Joakim

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to