HTML:
<body>
<table>
<tr>
<td><input type="button" value="Record"></td>
<td><input type="button" value="Play"></td>
<td><input type="button" value="Stop"></td>
</tr>
<tr>
<td><input type="button" value="Pause"></td>
<td><input type="button" value="Forward"></td>
<td><input type="button" value="Rewind"></td>
</tr>
</table>
</body>Android:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<Button android:id="@+id/RecordBtn"
android:text="Record" ></Button>
<Button android:id="@+id/PlayBtn"
android:text="Play" ></Button>
<Button android:id="@+id/StopBtn"
android:text="Stop" ></Button>
</TableRow>
<TableRow>
<Button android:id="@+id/PauseBtn"
android:text="Pause" ></Button>
<Button android:id="@+id/Forward"
android:text="Forward" ></Button>
<Button android:id="@+id/Rewind"
android:text="Rewind" ></Button>
</TableRow>
</TableLayout>Explanation:
If you know html then by now you know that there is no td and instead we use one of the the views/components in android.
This the most basic example of tableLayout, in the future post we shall tackle on some of its properties.
Update: Here is how you can set this as your layout in your java code

Hope it helps :)
0 comments:
Post a Comment