0

i'm making an app that requires indefinite textviews and images. i'm trying to implement a Pulse News app UI but having a hard time implementing one. so i thought of an idea to make a UI like that with the use of textviews, imageview and horizontal scroll view. textview string values are from parsed xml online and images or the imageviews will be images from a specific directory in the sdcard that my app is using.

can anyone give me ideas how can i do it without using an xml layout or is there any or other options or ways for doing this? thanks...

0

2 Answers 2

2

You can create a viewgroup with one textview and an image. Then it can be added dynamically to your layout many times. This can be done by creating objects in a loop. You can change the content in each viewgroup at the time of inflation.

Sign up to request clarification or add additional context in comments.

3 Comments

can you provide a link for example?
You can create an xml with one textview and image. Then you can inflate that into the layout you want. In the abouve example dynamicoption.xml is the view group. In this a viewgroup is added in each click
i found this link more useful: dreamincode.net/forums/topic/…
0

though i dont know what exactly how pulse new app looks like, but by going through your question (horizontal scroll view in particular) I guess you want to implement a "Gallery" type implementation where in you can swipe left/right on page basis.

If my assumption is correct then you will like to see to ViewPager of android backward compatiblity pkg.

1 Comment

i also came up with that idea too, and found JakeWharton's ViewPager cool but i'm using GreenDroid library for my UI now, still looking for other options, thanks.

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.