0

I would like to edit the value of one of the items in a style:

<style name="do_the_dog">
    <item name="android:layout_width">match_parent</item>
    <item name="android:layout_height">match_parent</item>
    <item name="android:visibility">visible</item>
    ...
  </style>

more info

The third item in the style is a visibility item. I was hoping I could change the value of that item to GONE or perhaps add an item for visibility.

Another thought is to add the item

<item name="android:id">@+id/dog_id</item>

to the style and do findViewById(R.id.dog_id).setVisibility(View.GONE). But this second idea has not worked so far. eclipse is not finding dog_id. And I think that's because I define it within the style; which I don't get since id is one of the items presented when I looked to see what I can define in the stylesheet.

learner
  • 11,490
  • 26
  • 97
  • 169
  • http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view Perhaps it is of any help? – Bram Feb 06 '14 at 15:20
  • thanks for the link. But my design is such that I have a style that defines 12 views. I want to set all the views to GONE with one stroke: by adding/editing a visibility item to the style in question. Otherwise it is laboring to do each one manually. I was hoping for object-oriented reusability – learner Feb 06 '14 at 15:24
  • I do not get the whole picture, regarding your description. Could you give a bit more information (edit your answer). About visibility gone. You could call setVisibility on the views: myView. setVisibility(View.GONE); – Bram Feb 06 '14 at 15:33

0 Answers0