Dynamic Table Generation and border for Android Development
Today, we want to talk about Dynamically generating tables and their borders. It is not difficult to generate a table dynamically, but it is difficult to generate a table border at the same time. Today, we will help you solve this problem. First, let's take a look at the comparison before and after the dynamically generated table, as shown below:
The effect is obvious! This is what we want. When we click the button, the table and its border are dynamically generated. So how is this implemented? Next, we will complete the specific implementation process of this project.
1. Create an android project named tablelayout;
2. Modify the main. xml layout file with the following code:
3. Create a New shapee. xml file in the Res/drawable-mdpi Directory, which is a custom image. I have already talked about the shape custom image in Android development. I will not elaborate on it here. If you don't understand it, let's look back. The content in the shappe. xml file is as follows:
4. Modify the main file with the following code:
5. Click the project to run it. The above results are displayed!
From http://www.cnblogs.com/nightshade/archive/2012/05/18/2507793.html