I have added UIPanGestureRecognizer on UITableCellView. I want to drag one cell and reorder it inside uitableview. Basically I want to achieve the functionality given in iPad keynote slide reordering.
Related
I wasn't sure what to title this without explaining it all there. Essentially, I want to populate part of a screen with a bunch of buttons. The buttons should have text from an ArrayList (or other structure) and they should be aligned horizontally to each other from the left to the right of the screen. When there is no more room to the right, it starts a new row. I've attached an example. Example layout here
I know how to make custom list adapters for my objects and how to make listeners for parts within the list items, but I'm just not sure how to make the "list" of buttons go horizontally with wrapping to the next line.
It seems https://github.com/google/flexbox-layout might help you.
You can use FlexboxLayoutManager as adapter, or simply place all the buttons inside FlexboxLayout, they will wrap automatically depending on their width.
I want to make some elements of my app able to be dragged and dropped by the user, so that the user can customize the position and design his own UI.
What I mean by drag and drop is that for example, when you hold and drag the icons or widgets on your phone, you can customize their position. So I want to make some text or images of my app function just like that.
Thanks for the help!
I have a custom cell layout, inheriting from MvxTableViewCell. One of the cell's contained views is a UILabel that supports text wrapping. The wrapping will mean the cells can be of different heights as that is driven by how much text is in each data item. The custom table cell is defined without any Storyboard or NIB. It is laid out in code and uses AutoLayout.
I am finding that the cells are being reused and the heights are staying the same as they were when they were previously used.
When the data source is updated and new items are in the table the previously taller cells are reused for cells that don't need that extra height. Do I need to create a custom MvxTableViewSource that has specific reuse logic? How would I even ensure that extra height rows were not reused?
I am hoping this is not a Monotouch and MVVMCross specific issue but just in case, this is how I am using the UITableView
this.searchResultsTable = new UITableView();
this.searchResultsTable.AccessibilityIdentifier = "SearchView_SearchResultsTable";
this.searchResultsTable.TranslatesAutoresizingMaskIntoConstraints = false;
this.searchResultsTable.RowHeight = UITableView.AutomaticDimension;
this.searchResultsTable.EstimatedRowHeight = 44.0f;
this.searchResultsTable.AllowsMultipleSelectionDuringEditing = true;
this.searchResultsTable.TableFooterView = new UIView();
The Table Cells display correctly on first use of the View but subsequent uses cause issues as does scrolling.
For example here is a screen shot of mixed height working followed by the same list after the taller row has been scrolled off the screen then back on. The red boxes show how box the cell should be (FWIW this is test data not real people's data)
Another example, here the table is again displayed correctly then loaded again with the same data yet the second load has the cell height incorrect
I broke my two issues into two questions however there is a solution for both this one and the other issue with this SO answer, UILabel not wrapping in UITableView until device rotate (iOS8)
The textarea-class in JavaFX should give me the option to add rows and columns, but the way I tried didn't work:
TextArea ta = new TextArea();
ta.setPrefRowCount(100);
ta.setPrefColumnCount(100);
I'm searching for columns/rows like in Microsoft Excel, inclusive the gridines.
.setGridLinesVisible(true);
doesn't work for this Type.
For use case similiar to Excel you're actually looking for TableView. Every table cell can contain anything, even another window so it is very flexible.
If you want grid lines on top of TextArea, but want to keep the standard TextArea behavior, you will have to combine the TextArea and TableView in a StackPane.
You will just have to clear the table's background using CSS.
However, matching the row and column sizes with the text will need some additional code.
Apologies for my English.
colums/rows like in Microsoft Excel, inclusive the gridines
TableView as recommended in Michael's answer is likely the right basic solution for.
There are some 3rd party controls you might consider which add some basic spreadsheet like functionality to the base JavaFX TableView control:
SpreadsheetView from the ControlsFX project.
TiwulFX from Panemu.
I am getting started with Android, trying to write a "concentration" game for kids where a screen full of text is separated into buttons, filling the screen (one word per button)
The buttons should wrap to the contained text, so longer words will have longer button widths.
Once a row fills up, the next button should flow to the next row, and so on, until the whole screen is filled with evenly spaced variable width buttons.
The number of rows and number of buttons per row varies based on screen size (and as mentioned, button width)
I could use a vertical linear layout, then insert horizontal linear layouts to contain the row text. However I don't see how to make those widths and number of rows vary based on the screen size and text size.
I presume I need to create my own custom layout, something like FlowLayout in Spring - if so, can you recommend a tutorial for how to do so?
Check android's API Demos
Animation->DefaultLayoutAnimation (for example)
LayoutAnimationsByDefault.java & layout_animations_by_default.xml (for source)
It uses GridLayout and with a bit of modifications of mentioned example, it will be useful for your case..It's flexible, it's available since API Level 14, but it's available trought support/compatibility library or 3rd party library .
Hope this will help.. Cheers ;)