1. Are you ready for the Galaxy S20? Here is everything we know so far!

XML Layouts Help

Discussion in 'Android Development' started by RozzaC, Apr 17, 2009.

  1. RozzaC

    RozzaC Android Enthusiast
    Thread Starter

    Are XML layouts editable through java classes?

    I'm trying to mess around with the Android 1.5 SDK in Eclipse.

    I'm working with the TableLayout Tutorial...

    So far...I've designed my own TableLayout with 2 TableRows...all set up in my layout/main.xml file.

    I've used my java class to create a TextView object...which works fine...

    And I want to try and get it to display in one of the TableRows I've created in my XML file.

    How would you go about doing that? x.x

    I hope that makes sense....

    If you want my code...I'll send it over to you...

    Thanks....
     



    1. Download the Forums for Android™ app!


      Download

       
  2. RozzaC

    RozzaC Android Enthusiast
    Thread Starter

    I managed to figure out what I needed to do to change the XML layout....although it's a little long winded, so I'm not sure if it's the most effective option...

    What I did was:

    - Make a new instance of whatever it is you want to change about the layout using the associated ID within the XML template...(a TextView for example)

    - Make the changes necessary to the new instances

    So far...all I learned is...it's pretty complicated to change a XML layout....so I most likely won't be doing that again... -_-

    ---EDIT---
    Actually...it's not all that long-winded....I realised...I can do it in 2 lines instead the 7 or 8 I had before.. XD

    I don't think you would be able to understand anything I've just written, so if you would like me to post my code up here...then I'll do that...

    Roz
     
Loading...
Similar Threads - XML Layouts Help
  1. App Update
    Replies:
    0
    Views:
    279
  2. KerenSophia
    Replies:
    1
    Views:
    396
  3. FlipperTime
    Replies:
    0
    Views:
    501
  4. FlipperTime
    Replies:
    0
    Views:
    483
  5. Armczbt
    Replies:
    0
    Views:
    953
  6. batboy
    Replies:
    7
    Views:
    2,347
  7. Thomas Thorton
    Replies:
    0
    Views:
    1,159
  8. janhrabe
    Replies:
    0
    Views:
    1,515
  9. Gleis
    Replies:
    1
    Views:
    1,836
  10. Abdul Qayoom
    Replies:
    2
    Views:
    1,083

Share This Page

Loading...