0

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

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

2 Comments

I mean, how can I do this programmatically in java?
stackoverflow.com/a/26133978/20839582 Check this answer and modify according to your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.