Front: Smobiler is a development platform that uses. NET language to develop apps in the VS environment, perhaps more convenient than Xamarin
First, the target style
We want to achieve the effect in the following actions:
1. Drag a TableView control to the form interface from "Smobiler components" on the toolbar
2. Modify the properties of the GridView control A.load event code
Vb:Private SubTesttableview_load (SenderAs ObjectEAsEventArgs)Handles MyBase. LoadDimMattableAs NewDataTableMATTABLE.COLUMNS.ADD ("Mat_desc1",GetType (String)) MatTable.Columns.Add ("MAT_DESC2",GetType (String)) MatTable.Columns.Add ("MAT_DESC3",GetType (String)) MatTable.Columns.Add ("Mat_desc4",GetType (String)) MatTable.Rows.Add () mattable.rows (0) ("MAT_DESC1") ="201503" mattable.rows (0) ("MAT_DESC2") ="MZ" Mattable.rows (0) ("MAT_DESC3") ="0" mattable.rows (0) ("MAT_DESC4") ="MatTable.Rows.Add" () mattable.rows (1) ("MAT_DESC1") ="201504" Mattable.rows (1) ("MAT_DESC2") ="MZ" Mattable.rows (1) ("MAT_DESC3") ="0" mattable.rows (1) ("mat_desc4") = "MatTable.Rows.Add" () Mattable.rows (2) ("mat_desc1") = "201505" Mattable.rows (2) ( "MAT_DESC2") = "mz" Mattable.rows (2) ("mat_desc3") = "0" Mattable.rows (2) ("mat_desc4") = "17" MATTABLE.ROWS.ADD () Mattable.rows (3) ("mat_desc1") = "201506" Mattable.rows (3) ("mat_desc2") = "mz "Mattable.rows (3) (" mat_desc3 ") = " 0 "Mattable.rows (3) (" mat_desc4 ") = " Me.tableview1 " . DataSource = mattable Me.tableview1.DataBind () End Sub
C#:private voidTesttableview_load (ObjectSenderEventArgsE{DataTableMattable =New DataTable();MATTABLE.COLUMNS.ADD ("Mat_desc1",typeofstring)); MATTABLE.COLUMNS.ADD ("MAT_DESC2",typeofstring)); MATTABLE.COLUMNS.ADD ("MAT_DESC3",typeofstring)); MATTABLE.COLUMNS.ADD ("Mat_desc4",typeofstring)); MATTABLE.ROWS.ADD (); mattable.rows[0]["MAT_DESC1"] ="201503"; mattable.rows[0]["MAT_DESC2"] ="MZ"; mattable.rows[0]["MAT_DESC3"] ="0"; mattable.rows[0]["MAT_DESC4"] ="17"; MATTABLE.ROWS.ADD (); mattable.rows[1]["MAT_DESC1"] ="201504"; mattable.rows[1]["MAT_DESC2"] ="MZ"; mattable.rows[1]["MAT_DESC3"] ="0"; mattable.rows[1][ "mat_desc4"] = "n"; MatTable.Rows.Add (); mattable.rows[2][ "MAT_DESC1"] = "201505"; Mattable.rows[2][ "MAT_DESC2"] = Span class= "col2" > "MZ"; Mattable.rows[2][ "mat_desc3"] = "0"; Mattable.rows[2][" MAT_DESC1 "] = "201506"; Mattable.rows[3][ "MAT_DESC2"] = "MZ"; Mattable.rows[3][" 0 "; Mattable.rows[3][" mat_desc4 "] = " 17 "; span class= "col" >this.tableview1.datasource = mattable; this.tableview1.databind (); /span> B.columnheaderstyle Property
This includes the Height property (column header height), the FontSize property (column header text size), the BackColor property (column header background color), and the ForeColor property (column header text color), 1;
Set the Height property to "10", 2;
Set the FontSize property to "5", 3;
Set the BackColor property to "White", 4;
Set the ForeColor property to "Black", 5;
|
|
|
|
| Figure 1 |
Figure 2 |
Figure 3 |
Figure 4 |
|
| Figure 5 |
C.columns Property
Open the Collection editor and click the Triangle button next to the Add button to select the type of column you want, including Tableviewlabelcolumn, Tableviewbuttoncolumn, Tableviewtextboxcolumn, Tableviewcheckboxcolumn and Tableviewimagecolumn Five kinds of columns, 6, figure 7;
D.gridlinescolor Property
Set the color of the TableView table line, set the property to "Black", 8;
E.location Property
Make the control appear in the appropriate position (0, 122), 9;
F.rowheight Property
Set the table row height, set the property to "15", 10;
G.size Property
Set the width and height of the control, set the property to (120, 77), 11;
|
|
|
|
| Figure 6 |
Figure 7 |
Figure 8 |
Figure 9 |
|
|
| Figure 10 |
Figure 11 |
Second, the mobile phone effect display
. NET Language app development platform--smobiler Learning log: How to implement form design on your phone