Android - Relative layout inside ScrollView - android

How can I put relative layout inside a scrollview? I want a scrollable view that contains pictures and texts like this:
I searched the Internet for solution or example, but in every sample project they use linear layout. Please help!
Thanks in advance.

Take a look at this tutorial it has exactly what you need.

Based on what you are describing + your mock, you should use a ListView with a header that contains your picture (on the top of the list)

Related

What techniques do you think duolingo used to make its lesson list in the app?(pic included)

I'm trying to make the duolingo lesson list for fun because im a big fan of the app, im a beginner programmer.
basically id like your opinion on how you think they did it.
here is what it looks like
https://s-media-cache-ak0.pinimg.com/236x/a3/a8/65/a3a865c47153078e7004b74652af7757.jpg
I think it might be a scroll view and linear layout, then perhaps a class for each icon/progress/name combo that will change based on progress
I think a table layout might be an easier solution.
Check it out here: https://developer.android.com/guide/topics/ui/layout/grid.html
I figured out how to do it, you need to use a scrollView followed by a linearlayout.
Then you can programatically add in relative layouts as rows and in those relative layouts make another square relative layout and in that relative layout you stack up the stuff like image/text/progress

Which layout should I use so my app looks like Google Plus?

I'd like to make a layout similar to the one used in the current version of Google Plus:
I don't know which layout I must use because :
- I can't use a GridView because it doesn't support spanning row.
- I can't use a GridLayout nor LinearLayout because the number of elements to show is dynamic
- I can't use a ScrollView because I want an AdapterView to re-use child elements
- I can use a ListView with two differents cells types but I can't use the built-in OnItemClickListener.
Do you have better ideas than me?
Thank you very much :)
this post suggested that it uses StaggeredGridView . I personally haven't tried it.
You can very well use RelativeLayout for this.
With a single Relative Layout you should be able to create exactly same layout.
Additionally, your content can be dynamically added to Relative Layout pretty easily (by setting proper LayoutParams to the content to be added).

Instructions layout for Android

I was looking into laying out some instructions on top of one of my applications like SoundHound does in one of their latest updates: http://i.imgur.com/D36nL.png
How is something like this achieved? Is this some sort of layout over another layout? Or a "dialog box" in a way?
You can create a frame layout with two children. The first would be the standard layout for the activity. The second would contain image views that display the help bubbles in the appropriate locations.
For more information see this: http://developer.android.com/guide/topics/ui/layout-objects.html#framelayout
Here is nice simple example: http://www.learn-android.com/2010/01/05/android-layout-tutorial/3/
You could just use a RelativeLayout with some elements having negative margins. They will overlap over other elements.

How to implement scrolling in TableLayout?

I have implemented simple database android application.In which I have displayed list of name and images.But if data is more then ten then table layout is not scrolling vertically.
Is it possible to implement vertical scrolling without using scrollview?
If possible then please provide me some reference.
Thanks in advance.
Why do you want to do it without using ScrollView? You can simply wrap your TableLayout inside a ScrollView to add the functionality.
I've always used ScrollView so I can't really give you a way to do this without using it.
Random link off Google that explains it pretty well: http://huuah.com/using-tablelayout-on-android/
As #Klaus said, you have to implement a ScrollView. Nonetheless, you can set
android:scrollbars="#null"
in the XML resource and in that way the scrollbar will be "invisible"
Hi
Here is a good article http://blog.sptechnolab.com/2011/02/01/android/android-custom-listview-items-and-adapters/. It is in LinearLayout but is someone write comment over there then i can convert the layout file into TableLayout.

How can I make a listview with more than a title?

I would like to have a special listview with a title, couple of sub-categories, and a picture. The picture below is a rough idea of how I would like to lay it out. I am very new to android so keep in mind that details really helps me. Thank you in advance.
You can create an xml layout that is used for each ListView item. If you haven't yet, read through Common Layout Objects for an introduction to the different layout types. There are also a "Hello layout" tutorial for each layout type, linked from that page.
In this case, you could use a horizontal LinearLayout with a vertical LinearLayout and an ImageView inside of it.
To bind your objects to the views within your ListView item, use a SimpleAdapter. You can find a number of tutorials on SimpleAdapters if you search around, for example.

Categories

Resources