Questions tagged [flowlayout]

Flow layout places components left to right and then top to bottom, allocating just enough place for each component.

Flow layout is similar to table layout but it allocates just enough width for each component. It has no "columns" because the width of the cells is most often different for every row. The difference between flow and table layout is less obvious when flow layout only has a single row (a quite common case in GUI).

345 questions
122
votes
4 answers

How to set UICollectionViewDelegateFlowLayout?

A UIViewController maintains a reference to a UICollectionView. The controller should modify the built-in flow layout using the UICollectionViewDelegateFlowLayout. It's pretty easy to set the view's data source to self: MyViewController.m -…
Rich Apodaca
  • 28,316
  • 16
  • 103
  • 129
90
votes
17 answers

Swift: How to refresh UICollectionView layout after rotation of the device

I used UICollectionView (flowlayout) to build a simple layout. the width for each cell is set to the width of screen using self.view.frame.width but when I rotate the device, the cells don't get updated. I have found a function, which is called…
Talha Ahmad Khan
  • 3,416
  • 5
  • 23
  • 38
42
votes
1 answer

UICollectionView animating cell size change causes undesired behavior

I have a UICollectionViewController that using a standard UICollectionViewFlowLayout to display a single vertical column of cells. I am attempting to create an expand/collapse animation on a cell when a cell is tapped. I use the following code to…
Cory Breed
  • 423
  • 1
  • 4
  • 8
26
votes
1 answer

Why does FlowLayout behave differently in Qt 5.2, compared to Qt 4.8?

I've just ported my application from Qt 4.8.4 to Qt 5.2.1. I have an issue with the FlowLayout class as provided in the FlowLayout example code in the Qt docs. I have a QMainWindow with a QDockWidget docked at the bottom of the central widget. The…
c_k
  • 1,746
  • 1
  • 20
  • 35
21
votes
5 answers

UICollectionView (Automatic Size) .reloadData() resets contentOffset to 0 (top)

I have a UICollectionView using a standard UICollectionViewFlowLayout with an estimatedItemSizeset to UICollectionViewFlowLayoutAutomaticSize. Once I call collectionView.reloadData() the scroll position of the view resets to CGPoint(x: 0, y: 0). I…
Aaron
  • 269
  • 3
  • 11
20
votes
2 answers

UICollectionView header position in horizontal scroll direction mode with flow layout

I have ios UICollectionView with Flow layout with horizontal scroll direction. In this situation typical header position is on the left side of cells. I want to make header on the top of section cells Have you any idea how can I do this?
greg_pl
  • 211
  • 1
  • 2
  • 5
18
votes
2 answers

How can I let JToolBars wrap to the next line (FlowLayout) without them being hidden ty the JPanel below them?

I am in the process of making a GUI which shows three JToolBars above a big JPanel. These toolbars are collectively very large, so I'm using a FlowLayout to make them wrap to the next line if they reach the JFrame border. The problem is that when…
Shawn
  • 10,931
  • 18
  • 81
  • 126
17
votes
2 answers

how to keep radio-button or checkbox and its label together when content wraps in flow layout

How to keep the radio button ( ) or checkbox [ ] and its label together when text wraps as the browser window is made narrower, so that we don't end up with this: [ ] pepperoni [ ] anchovies [ ] mushrooms [ ] olives EDIT…
Tim
  • 8,669
  • 31
  • 105
  • 183
15
votes
3 answers

Recycler View with multiple rows and columns - AutoFit like Flow Layout [Android]

I'm in a challenge to build a layout like this: My first insight was to use a RecyclerView with an adapter that can deal with each item and inflate its layout. So far, not so good. I got this layout so far: I can felling that I'm almost there, but…
14
votes
1 answer

UICollectionViewLayout and method layoutAttributesForItem is never called

I am trying to implement a UICollectionViewFlowLayout or UICollectionViewLayout - any ways the layoutAttributesForItem is never called. I can see from others that they call layoutAttributesForItem from self.layoutAttributesForItem. Like this flowout…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
11
votes
4 answers

Change scroll direction in UICollectionView

I have a UICollectionView which I have setup, everything works fine (selection, headers, etc), however, I want to change the scroll direction in some situations. In short if I go into the story board and change the scrollDirection it works fine but…
Recycled Steel
  • 2,272
  • 3
  • 30
  • 35
10
votes
1 answer

UICollectionView layout of last cell

I have a collectionview which has a UICollectionViewFlowLayout I put 10 items in it. and they have different sizes: - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout…
NickYu
  • 594
  • 1
  • 5
  • 13
10
votes
2 answers

How to align JLabel to the left of the JPanel?

I want to align my JLabel to the left. String lText = "mybook"; JLabel label = new JLabel(lText); label.setBorder(new EmptyBorder(25,0,25,500)); I tried to do…
Archit Verma
  • 1,911
  • 5
  • 28
  • 46
9
votes
3 answers

How can I get FlowLayout to align JPanels at the bottom like it does for other components?

I have a case where I am adding JPanels to a FlowLayout, and they are not aligning themselves to the bottom of the layout. I'm using this layout.setAlignOnBaseline(true) and it properly aligns JLabels to the bottom of the panel. However, once…
Glucose
  • 93
  • 1
  • 5
9
votes
2 answers

Change JSpinner Size (width)

My problem: JSpinner is so skinny that I can only see the chars on the string in the last spot. ex: "Hello" I only see 'o'. I have a JPanel in a JFrame's BorderLayout.SOUTH The JPanel's layout manager is the default which is - correct me if I'm…
UTSAstudent
  • 111
  • 1
  • 2
  • 3
1
2 3
22 23