0

I have a CustomViewGroup with few textViews.

I want to create a themes "big" and "small" to change the first text size and margins.

How can i do this? as i have found 3 posts about themes and styles, but i think it's not possible when i have to set the style for just one textView (how do i select it specifically?)

1) I have seen this post

but wasn't sure if that's a usable syntax:

style="?textBody"

plus is it possible to setTheme to just current context? (In my current customView)

2) I have seen this post

but I don't understand how does each attribute linked to a specific view (say i have two text views and i want to change the style of just one of them)

or does that mean that any button will get this attribute?

<style name="Widget.ImageButton.Custom" parent="android:style/Widget.ImageButton">

3) I have seen this post which i undrestand you can set style only views only when creating them via code (not xml)

Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • How is your CustomViewGroup created? Are both the parent and child views defined in the same XML file (e.g. ``) or are you inflating them in the constructor of CustomViewGroup? Or something else entirely? – Ben P. Nov 12 '18 at 15:52
  • both the parent and child views defined in the same XML file – Elad Benda Nov 13 '18 at 08:28

0 Answers0