FMX.Mobile.SimpleListView Sample (Object Pascal)
You can find the SimpleListView Sample project at:
- Start | Programs | Appmethod | Samples and then navigate to Object Pascal\Samples\User Interface\ListView
- Subversion Repository: http://sourceforge.net/p/Appmethod/code/HEAD/tree/branches/Appmethod_113/Object%20Pascal/Samples/User%20Interface/ListView
When you run the application, it shows a list view and an Edit button on top. You can tap the Edit button to enter edit mode.
In edit mode, a Delete button appears at the bottom of the application. You can select list items and then tap Delete to remove them from the list. Also, in edit mode the Edit button turns into a Done button that you can tap to return to display mode.
How to Use the Sample
- Navigate to the location given above and open SimpleListView.dproj.
- Press F9 or choose Run > Run.
The Edit button is located at the top-right corner of the application. The application handles the OnClick event of this button, where it enables the edit mode of the list view, shows the Delete and Done buttons, and hides the Edit button.
The Delete button is located at the bottom-left corner of the application, and is hidden by default. The application handles the OnClick event of this button. This event handler deletes any selected list view item.
The Done button is located at the top-right corner of the application, overlapping at design time with the Edit button. However, Done is hidden by default. Edit and Done never overlap at run time. The application handles the OnClick event of the Done button as well. Its event handler disables the edit mode of the list view, shows the Edit button and hides the Delete and Done buttons.