I've got a question about Xamarin Android GridLayout:
How can I make spacing between the cells in a GridLayout?
Thank you very much!
Are you using custom Views for each cell or are you creating all the cells in the layout file?
If you are creating all the cells in the layout file like in this example,
you can use the android:padding attribute on each cell to add the amount of space you want to each element. If you are adapting custom views to the GridLayout, you can use attributes in the layout you are inflating like padding or layout_margin.
You can use android:verticalSpacing and android:horizontalSpacing in your GridView to make spacing between the items. Check this answer here, it might help you:
Increase the grid spacing in android
Hope this solves your problem. Cheers!
Related
I want to display a large list of items in horizontal direction. I found GridView which uses UICollectionView (for iOS) or RecyclerView (for android) which is working properly in vertical direction. But I cannot find a way to make it horizontal.
I was wonder is there a way to use this component in horizontal direction or is there another component for this purpose?
PS: I don't want to use a normal ScrollView because it does not use lazy loading for items and for large lists, it will destroy performance of the app.
Thanks
You may use RadListView here and set the scrollDirection to Horizontal on the item layout.
npm i --save nativescript-ui-listview
This is Layout I'd like to draw in my ContentPage(ListView is just added)
I tried to use a Grid with a row and two columns in which to place two BoxView inside the first one a further Grid with 3 rows and two columns for the Label in the second Box a Label but the result was disappointing
There are a few options. You can use Grid with Margin and Padding properties so the contents won't be too close to one another. Or you can use AbsoluteLayout or RelativeLayout so you can position every single elements as the way you want to. You can read the documentation for layouts for more information.
I want to avoid horizontal scroll in Vaadin grid and oblige column to be resized according to the screen. I tried grid.setExpandRatio() but I have no change.
Have you any idea please?
The Vaadin Grid component provides width control for each column. See API doc.
You can set expand ratio of each column that is added when additional free space is available beside the space that is required for each column. But this doesn't help in your case. The best way I found so far is to set a maximum width for a column that is suitable for shrinking.
I have a layout that requires an MvxTableViewCell to render an inner UITableView. I can get the layouts working pretty nicely with FluentLayout except that I can't seem to get the hosting cell to render until I set a static height. The problem with this approach is that I'd like the cell to only occupy the space needed for the inner UITableView without having potential extra space because of a static size (which feels dirty in any event). Any idea how I can tackle this problem?
Sigh. I know this makes me look idiotic, but I think I've found the start of my answer here:
Using Auto Layout in UITableView for dynamic cell layouts & variable row heights
Apologies for cluttering the internet.
I have NSSplitView with NScrollView inside it and view-based NSOutlineView inside NSScrollView, it has e.g. one column. My outline view must be scrollable vertically only and it must consider minimal width of column content to fit it. I think they must return -(NSSize)fittingSize with values {minColumnWidth, 0}, but it returns {0,0}. How can I do that?
Try to return the desired view size in (NSSize)intrinsicContentSize. I am not sure if I totally understand your scenario. You could add a screenshot or wireframe to make it easier to understand the setup. Whatsoever, take a look at my question dealing with a similar problem.
Maybe also check out the WWDC Session 232 - Auto Layout by Example. It covers a new split view API together with Autolayout (starting around 41:00 minutes).