Questions tagged [grid-layout]
Grid layout is used to align content into columns and fields. Unlike table layouts, grids are composed of guide lines so that elements positioned relative to the grid can have drag and drop behavior.
grid-layout
2,194
questions
8
votes
1
answer
11k
views
PyQT5: Grid layout inside horizontal layout
Can someone help me figure out how to combine layouts?
Taking offset from the guides from: [https://pythonspot.com/en/pyqt5/]
I would rather not use Designer as the layout is going to be a part of ...
8
votes
2
answers
4k
views
Make elements wrap in groups, not one by one
I have six inline, fixed-size elements and would like to wrap them so that each row has the same number of elements. So with a wide container, there would be 1 row with 6 columns / elements. As the ...
8
votes
1
answer
15k
views
GridLayout vs TableLayout
I'm unsure as to what the differences between the two of them are and which I should use for my purpouses?
What I'm trying to do is create a custom virtual numpad with text inputs and that can ...
8
votes
2
answers
5k
views
How to create dynamic drag and drop layout with react-grid-layout
I am using react-grid-layout to make drag-drop and resize components, So i am able to achieve the functionality as mentioned in the doc.
My Issue
I am creating dynamic UI so I am rendering my UI with ...
8
votes
1
answer
23k
views
Shrink grid items just like flex items in css
Is it possible to shrink grid items just like flex items in css?
Grid items
.container {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
....
8
votes
3
answers
20k
views
Changing width of GridLayout
I use the GridLayout for my JPanel and was wondering, if it's possible to change the width of the columns:
GridLayout grid = new GridLayout(5,2);
panel.setLayout(grid);
Is there a simple way?
8
votes
4
answers
11k
views
Prevent grid items from expanding when content is added
I'm trying to create a layout where the screen is divided into some number of equally-sized cells. When I fill one of the cells with content, it stretches to be larger than the other cells, even ...
8
votes
1
answer
4k
views
Programmatically creating a GridLayout from support library
In android, is it possible to create a GridLayout from the support library entirely programmatically (i.e. without writing corresponding xml)?
I create my GridLayout in a fragment (called ...
8
votes
1
answer
10k
views
How to create 3x3 grid menu in react native without 3rd party lib?
I want to create grid center menu in react native, I just read the doc and looks good to start, but I have a problem to creating line for each grid menu
I've created 3x3 grid flexbox with Copy-Paste ...
8
votes
1
answer
3k
views
Hide row in GridLayout
I have made a GridLayout in an xml file with 3 columns and 2 rows.
How can I hide the second row via code?
I tried to set visibility gone for the views inside that row but the first column seems to ...
7
votes
3
answers
12k
views
Tkinter Grid Dynamic Layout
I am wanting to create a grid layout, with a grid that fills the first row until it runs out of space in the window, and will dynamically move items to the row below (like text line-wrapping). As the ...
7
votes
2
answers
29k
views
Java Swing: How can I change the size of one row in a Grid layout and allow it to resize dynamically only horizontally and not vertically?
Hi everyone I have a JFrame which has three components inside.
A menu
A tabbed pane
a panel that has some buttons
Initially my goal was to create a design like the following:
when the user would ...
7
votes
2
answers
21k
views
How to increase padding between columns using Bootstrap 3.0
I am relatively new to programming and am making a website using bootstrap 3.0.
I want to make two rows that center in the middle of the page. For the first row I used div class="col-md-4 col-md-...
7
votes
3
answers
9k
views
Android gridlayout overflowing screen
I have this code:
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:...
7
votes
2
answers
19k
views
Android, Horizontal and Vertical Scroll for GridLayout
I'm having trouble getting a GridLayout to scroll horizontally.
I found a similar question Gridlayout + ScrollView. I tried that method, but it didn't work.
It cuts out many tables (because it was ...
7
votes
3
answers
11k
views
Making the content inside grid items equal height in CSS Grid
I am trying to figure out how to get two columns of my grid the same height. Here is what I am after:
xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
x qqqqqqqqqqqqq x x qqqqqqqqqqqqqqq x
x ...
7
votes
1
answer
5k
views
Inline Grid related CSS disappear in Gmail [duplicate]
I am working on a HTML email template using NopCommerce. I've put all my CSS inline since and doesn't work, for the most part everything works except for the Grid styles. Specifically grid-gap and ...
7
votes
1
answer
15k
views
Centering columns in CSS Grid
I'm trying to create a simple css grid using the native CSS Grid properties. It works as I wanted, except I want to create a utility class that can center a column in a grid.
Is there a way to create ...
7
votes
4
answers
14k
views
Android GridLayout get row/column
I have a 3x3 GridLayout with buttons. These buttons have a onTileClicked() listener. Now I want to get the position of the clicked button in the grid. Here is my code:
public void onTileClicked(View ...
7
votes
1
answer
15k
views
Horizontally center Views inside Android GridLayout
We are writing an app targeting ICS+ and believe a GridLayout is the best layout paradigm, but it seems very little has been written about it, and we are having some alignment issues.
<GridLayout
...
7
votes
1
answer
5k
views
How to horizontally center a Gtk.Grid inside a vertical Gtk.Box?
I have a Grid containing some Labels inside Frames to make it look like a table. This grid is inserted in a vertical Box in which direct child Labels are centered correctly (they are packed in the box ...
7
votes
2
answers
466
views
Alignment not right when adding view dynamically to GridLayout
When added buttons by XML - All good
<GridLayout
android:id="@+id/social_gl_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:...
7
votes
1
answer
19k
views
Responsive Grid of Squares in Bootstrap
I want to create a grid of responsive images that are always squared in Bootstrap.
So far I got this: Jsfiddle Link
This part forces the elements to be squared all the time:
.frontpage_square {
...
7
votes
2
answers
12k
views
CSS Grid Layout with Max-Width, Centered Content
I'm in the midst of learning CSS Grid (long overdue, I know). I've challenged myself to convert a relatively standard float-based layout to a grid, but can't figure out this last part.
My goal is to ...
7
votes
3
answers
1k
views
efficiently calculate locations for rectangles in a unit grid
I'm working on a specific layout algorithm to display photos in a unit based grid. The desired behaviour is to have every photo placed in the next available space line by line.
Since there could ...
7
votes
4
answers
2k
views
Align items with different heights in a grid and have them match lines of alignment
I want to create a page where my elements are displayed in a Grid. I want to align the items by line. I want to achieve visually the following result, but I don't know how: https://codepen.io/shirkit/...
7
votes
4
answers
912
views
dynamically created imageview in gridlayout not working
I want to set captured image to dynamically created imageview in same gridlayout but it creates a new grid layout and sets the captured image to the new gridview.
This is my mainactivity.java file
...
6
votes
7
answers
13k
views
How to determine which grid option is currently used
I use Bootstrap 3 for a web page that is created using PHP and HTML.
With the responsive grid and classes on Bootstrap 3 you can assign multiple classes to a div to define different widths depending ...
6
votes
3
answers
16k
views
GridLayout in Kotlin?
I am trying to get a 2x6 (WxH) GridLayout in my Kotlin Android application. I have my xml and fragment / adapter set up for a RecyclerView but am a bit at a loss for as how to apply a GridLayout to ...
6
votes
2
answers
6k
views
Trying to make an isometric grid programmatically using Swift
The only reason I'm attempting this programmatically is so I can access the locations of each tile, making it possible to manipulate the grid. I've looked at about 15 different tutorials using other ...
6
votes
2
answers
37k
views
css grid-template-areas property not aligning grid items [duplicate]
I am new to css grids, and I am trying to build a page with this layout:
The problem I have is the .main class and the grid inside the container grid.
I think I have the wrong setup for the grid in ....
6
votes
3
answers
876
views
How do I create the following GUI in Java Swing?
I want to create the following GUI with Java Swing.
Since I'm not experienced enough with Java Swing, I'm not sure how to exactly recreate that GUI.
I've tried using GridLayout which looks like this:...
6
votes
2
answers
15k
views
What are the parameters for a GridLayout?
private static final GridLayout layout = new GridLayout( 3, 1, 1, 0 );
in this line of code what do the numbers represent and how do you use them to arrange the checkboxes and buttons in the window?
6
votes
5
answers
8k
views
How to fill a GridLayout top-to-bottom and then left-to-right?
The default behavior of a GridLayout is that the components are filled row by row, and from left to right. I wonder if I can use it so that the components are filled by columns (from left to right)? ...
6
votes
1
answer
4k
views
Dynamic GridLayout with fixed size
Guidance required..
Would like to achieve something like the image below whereby the child panel stays the same size but contains up to 4 components. I realize I can achieve this by changing the ...
6
votes
2
answers
22k
views
How to embed a grid layout inside a border layout in java
I have a border layout and I want to add a grid layout to the center section. However, I can't declare a grid and then add my center border. How can I do this?
public Liability_Calculator(String s)
{
...
6
votes
1
answer
8k
views
Twitter Bootstrap grid not working as expected
I'm using a premium Wordpress theme based on Twitter's Bootstrap. The theme is called StrapPress.
I'm just getting going with the grid and trying to set things up in a very basic way, but the grid is ...
6
votes
1
answer
5k
views
How to replace content of grid cell in SWT GridLayout?
I need to replace content of grid cell after button click. For example: there is Label and I need to replace it with Text. Is it possible with GridLayout? I need to use SWT.
6
votes
2
answers
23k
views
Create a 4x4 responsive grid of squares with a margin of 20px on each side of the container? [duplicate]
I want to create a grid of responsive 4x4 squares with a margin of exactly 20px on the left and right sides of the overall container. Furthermore, this would effectively eliminate the left margin on ...
6
votes
2
answers
5k
views
How to using mouse to change size of grid layout cells using Qt?
I use grid layout (horizontal and vertical too). I like the fact that when resizing the window fills the entire window contents. but this extension is poorly managed. I often want to change the size ...
6
votes
1
answer
11k
views
Qml GridLayout how to specify a column width?
I have a column with two groupbox which each have a GridLayout.
Here is my code:
Window {
visible: true
width: 500
height: 480
title: qsTr("GridLayoutTest")
Column
{
GroupBox
...
6
votes
1
answer
6k
views
SWT: Nested Layouts with ScrolledComposite exceeds available space
I want to build a Master-Detail layout for one of my applications using SWT.
Container, Content, Sidebar and Part1 are Composite instances.
Scrolled is a ScrolledComposite
The desired layout is ...
6
votes
4
answers
3k
views
Flex container with four divs, need three columns, second column with two rows
For a section on a page, I am trying to display two rectangular divs stacked up between two square divs on either side as big as the height of the two stacked divs, inside these divs are img tags.
I ...
6
votes
3
answers
4k
views
How to use MouseListener to find a specific cell in a grid
I'm trying to create a Java game with a 10 x 10 grid made up of cells.
The Grid looks liks this:
public class Grid extends JPanel implements MouseListener {
public static final int GRID_SIZE = 10;...
6
votes
1
answer
3k
views
SetGravity for GridLayout not working
I am using a simple GridLayout to which I'm adding buttons dynamically.
<GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tagGridLayout"
android:...
6
votes
1
answer
3k
views
How to make a CSS GRID, with uneven column widths, responsive?
I have created a CSS GRID and each row has 2 columns. The first column takes up 25% of the width and the second column takes up 75%. I have achieved this using
.grid-container{
...
6
votes
1
answer
2k
views
Expanding flex items to full width
I'm attempting to create a custom 'iTunes' style expanding layout. However, I am hitting a few issues. I had originally anticipated using flex-box for this. But I can't quite seem to do what I am ...
6
votes
1
answer
10k
views
Gridlayout with borders
I'm a new Android developer, and I'm just trying to improve my skill by reading some samples, I want to design a new interface using GridLayout, I've checked a lot of samples but I can't seem to draw ...
6
votes
2
answers
537
views
Wrap CSS grid with auto placement
I'm trying to build a grid that contains card-like items. The cells of each type (headline, image, text, button, ...) should have equal height in each row, determined by the content of the largest ...
6
votes
1
answer
3k
views
CSS Grid Layout - Make an item span as many column as needed
I want to use a CSS-Grid-Layout (ideally with an explicit column-grid).
And I would like to have a flexible item that absorbs any extra space along the x axis / spans as many columns as are not used ...