Reputation: 21
I basically want to have several views aligned with each other using a relative layout. I can do so using xml, but unfortunately I can't find any documentation that tells me what methods I need to call to get the same effect in code (All the examples and things just use xml). Since the imageviews are being made dynamically xml isn't an option for what I want to do. I've looked at layoutparameters which seems to let me change some options, but I'm not seeing a method that will let me change alignment relative to another view. Any help is appreciated.
Upvotes: 0
Views: 467
Reputation: 21
After playing around with it some more found that addRule
is the method I need. Couldn't find it because I was looking for something with the term alignment in it.
Upvotes: 1
Reputation: 24625
Check out setLayoutParams
in the Android documentation:
https://developer.android.com/reference/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams)
Upvotes: 0