I'm trying to make some auto fill grid, but without know the width from every item. So, the width from child can be deferent in every row and every column. It only depends from a TextView.
I want something like this.
I'm tried with GridLayout and android:numColumns="auto_fit" but isn't what I'm looking for.
I also check this post but is basically same as GridLayout.
Anyone know some other solutions??
Flexbox-Layout is a project by Google to provide both a simple view and a RecyclerView layout manager that does what you want. https://github.com/google/flexbox-layout
I think the following tutorial might be a solution for the current problem u r facing
Tutorial
Hope it helps ;)
Related
How to create Horizontal listview that has maximum of 3 row and more column it depends on the data just like in this picture
Link:https://i.stack.imgur.com/cUJjB.jpg
This is my concept don't mind the design i just want to know how to create that kind of list view
You can try FlexLayout.
FlexLayout is similar to the Xamarin.Forms StackLayout in that it can
arrange its children horizontally and vertically in a stack. However,
the FlexLayout is also capable of wrapping its children if there are
too many to fit in a single row or column, and also has many options
for orientation, alignment, and adapting to various screen sizes.
More information can be found in the official documentation.
Set the ItemsPanel of the ListView to a horizontal StackPanel.
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
From this question.
Edit: This solution may actually not work for you. If it doesn't work, take a look at this library. It might help you.
I need to make this UI in android and I know that I can do it with the help of GridView but what I cannot understand is that how to set the margin for the TextView.
Can anyone help me with this?
Or any other suggestion except GridView. I was even thinking of RecyclerView.
Maybe this library could be interesting for you.
I am new to android, I have arranged five LinearLayouts in a horizontal way, if I click the first first LinearLayout it will expand and the other layouts remain in the same position, please help me.
This is the layout design :
As the way you stated, I suggest you to use ExpandableListView
You can see for tutorial HERE
Since you're new, you're gonna have to learn anyway. Since the functionality you're looking for can be easily implemented using a Horizontal ListView, I suggest you try this approach rather than using five LinearLayouts. ListViews have extensive controls. I recommend this implementation from experience : HorizontalVariableListView. Hope this helps!
i need make a list that not have scrolling, because i will have two lists, and wish you had just one scroll, and they were wrap_content, there exist object to make it?
Thanks in advance
Sorry by my English
I up a image to you understand me
http://imagizer.imageshack.us/a/img819/4513/m0u2.jpg
listView.setScrollContainer(false);
More you can read here.
You should set fixed height for each ListView, using weight in your xml.
The way to do this: link.
in my project i have 9 image buttons which must come in 3 rows and 3 columns each image must be given a label or text beneath it as explaining it so is it good to use GridLayout or which layout will be best suitable for this situation and please suggest tutorial on suggested layout.
thanks
Here you go with it.
I would suggest you to use TableLayout if you have fixed no of views and will not change however if there is a chance of your views to increase then use GridView it uses adapter which manages memory it self.
Here is a good link to start off
http://www.androidhive.info/2011/07/android-layouts-linear-layout-relative-layout-and-table-layout/
Best of Luck