I have XML file where I display information using LinearLayout vertical. All what I need to do is to create horizontal LinearLayout and attach there an image and a TextView. Then I need to display this horizontal LinearLayout on my main vertical LinearLayout. How can I do this? I need to do this programmatically in java
Asked
Active
Viewed 40 times
1 Answers
1
First create a LinearLayout with orientation = vertical then create another LinearLayout inside this with orientation = horizontal with your image and textview. Like this
<LinearLayout
android:orientation="vertical"
>
//Your other views
<LinearLayout
android:orientation="horizontal"
>
// Your image and textview
</LinearLayout>
</LinearLayout>

sajidjuneja
- 184
- 7
-
I mean, how can I do this programmatically in java? – Timur Jan 08 '23 at 11:48
-
https://stackoverflow.com/a/26133978/20839582 Check this answer and modify according to your code. – sajidjuneja Jan 08 '23 at 11:50