flowlayout

UICollectionView custom flow layout crashes on scrolling

纵饮孤独 提交于 2019-12-22 18:24:06
问题 I am creating a custom flowLayout with section headers. here is my flowLayout.swift import UIKit class FlowLayout: UICollectionViewFlowLayout { override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? { // let attributesForElementsInRect = super. var newAttributesForElementsInRect = [UICollectionViewLayoutAttributes]() // unwrap super's attributes guard let attributesForElementsInRect = super.layoutAttributesForElementsInRect(rect) else { return nil

UICollectionView header position in horizontal scroll direction mode with flow layout

核能气质少年 提交于 2019-12-18 18:48:50
问题 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? 回答1: I think you can get what you need using standard behavior for the header. Set it up (probably in viewDidLoad): UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; flowLayout.headerReferenceSize = CGSizeMake(self

C# I don't understand why this button won't delete

蓝咒 提交于 2019-12-13 23:06:52
问题 basically... When the user accepts or rejects a friend request it is supposed to remove the user's name, accept and reject button but it only removes the user's name and reject button. I don't understand. Code: private void loadFriendRequests() { using (SqlConnection connection = new SqlConnection(con)) { using (SqlCommand cmd = new SqlCommand(@"Select IDRequest, UserFirstName, UserLastName, FriendEmail From PendingRequests Where FriendEmail = @fe", connection)) { connection.Open(); cmd

how to place last component of a jPanel on the right edge, even if the panel has a flowLayout Left

本秂侑毒 提交于 2019-12-13 02:57:18
问题 I have in my code : a jPanel with LEFT FlowLayout. It contains various components. see img: what i'm trying to implement: I'm trying to stick last component on the right edge of its panel container. See img: i tried: to add a Box.createHorizontalGlue before my last component, but it doesn't work as expected. The Code: Code has been created on purpose for the question and mirrors the original code logic: public class TheMotherPuckerGlue { public static void main(String [] a) { final JFrame

Java Swing components not showing

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:56:04
问题 Help me! Whenever I try to start up the code below, it shows only the button on the bottom and the password field everywhere else. I want to be able to see everything, but I can't public void setup(){ frame = new JFrame("Votinator 3000"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); voteconfirm = new JLabel(""); textarea = new JTextField(1); submit = new JButton("Submit Vote!"); chooser = new JList(items); password = new JPasswordField(1); password.setVisible(true); choices = new

Is it possible to restrict specific rows in FlexboxLayoutManager of RecyclerView?

回眸只為那壹抹淺笑 提交于 2019-12-12 17:46:16
问题 Background I need to create a UI of a details screen, which includes various fields, in a list fashion. This is why I chose to use RecyclerView, because there could be a lot of fields and I don't want that all views will be inflated from start. The problem in one of the rows, I actually have to put tags. The row has a title like most of the other rows, and might have an icon on the right like most of them, yet the real content is the tags themselves. They wrap if there is no more space.

Get preferred size of multi-line flowlayout

独自空忆成欢 提交于 2019-12-12 10:38:26
问题 I can't figure out a way to resize some components in a swing GUI. Some custom labels are being added to a FlowLayout which doesn't behave how they should when resizing the dialog. The panel is being built using the jgoodies forms framework. If using this, where the FlowLayout is being added to xy(3, y) FormLayout layout = new FormLayout("r:d, 5px, f:d:g", // columns "p, p, 5px, p, 5px, p") // rows The FlowLayout expands and a scroll bar shows up If using FormLayout layout = new FormLayout("r

Android-Flow Layout in JAVA

巧了我就是萌 提交于 2019-12-12 06:31:05
问题 I m giving 3 sentences in 3 text views in JAVA file in horizontal orientation but only 2 text view that is only 2 sentences are comin but the third sentence gets disappeared due to the resolution of the mobile. My query is how to get the third text view in a new line from the starting postion of the second line and not at the last. public class MainActivity extends Activity { private LinearLayout layout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

JTextField Size Changing When I Change The Font

夙愿已清 提交于 2019-12-12 03:42:02
问题 When I Change The Font Of My JTextField The Actual JTextField Resizes, Any Help? I am working on a calculator and obviously based on how bad the code is you can tell the I am a noob Any Help Would Be Appreciated CODE: import java.awt.BorderLayout; import java.awt.Color; import java.awt.ComponentOrientation; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import javax.swing.JButton; import javax.swing.JFrame; javax.swing.JTextField;

Change panel size in flow layout

前提是你 提交于 2019-12-12 01:54:18
问题 I am developing a GUI form in java. In that I am adding two panels in main frame which has FlowLayout . But now I want to change the size of panels and I tried changing using setsize() , and I can see no difference. Here is my code: public class Main_window extends JFrame implements ActionListener { JFrame MainFrm = new JFrame("MCQ Generator"); JPanel LeftPanel = new JPanel(); JPanel RightPanel = new JPanel(); JButton BrowseButton = new JButton("Browse/Open"); TextArea ta1 = new TextArea();