Home  >  Article  >  Backend Development  >  Spread Zhike ASP.NET Advanced Series Video Material Sharing

Spread Zhike ASP.NET Advanced Series Video Material Sharing

巴扎黑
巴扎黑Original
2017-08-31 11:24:121781browse

In the previous video tutorial, we introduced the ASP.NET intermediate tutorial. Today I will introduce to you the "Spread Zhike ASP.NET Advanced Series Video Tutorial". ASP.NET is an enterprise Web application development technology platform led by Microsoft. It is currently the One of the most popular web development technologies, it can develop a variety of functionally complex websites.

ASP.NET, also known as ASP+, is not just a simple upgrade of ASP, but a new generation scripting language launched by Microsoft. ASP.NET is a Web development platform based on the .NET Framework. It not only absorbs the greatest advantages of previous versions of ASP and adds many new features based on the development advantages of Java and VB languages, but also corrects the running errors of previous ASP versions.

Spread Zhike ASP.NET Advanced Series Video Material Sharing

Video playback address: http://www.php.cn/course/637.html

The difficulty of this video is Learning of ListVeiw:

The display of the list requires three elements:

1. ListVeiw View used to display lists.

2. Adapter is used to map data to the mediator on the ListView.

3. Data The specific string, image, or basic component that will be mapped.

According to the adapter type of the list, the list is divided into three types: ArrayAdapter, SimpleAdapter and SimpleCursorAdapter

Among them, ArrayAdapter is the simplest and can only display one line of words. SimpleAdapter has the best scalability and can customize various effects. SimpleCursorAdapter can be thought of as a simple combination of SimpleAdapter with the database, which can display the contents of the database in the form of a list.

We start with the simplest ListView:

/**
 * @author allin
 *
 */
public class MyListView extends Activity {
 
    private ListView listView;
    //private List<String> data = new ArrayList<String>();
    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
         
        listView = new ListView(this);
        listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1,getData()));
        setContentView(listView);
    }

 private List<String> getData(){
         
        List<String> data = new ArrayList<String>();
        data.add("测试数据1");
        data.add("测试数据2");
        data.add("测试数据3");
        data.add("测试数据4");
         
        return data;
    }
}

The above code uses ArrayAdapter(Context context, int textViewResourceId, List objects) to assemble the data. To assemble this data, you need an adapter that connects the ListView view object and the array data to adapt the two. The construction of the ArrayAdapter requires three parameters, in order this, the layout file (note that the layout file here describes each element of the list. One-line layout, android.R.layout.simple_list_item_1 is a system-defined layout file that only displays one line of text and the data source (a List collection). At the same time, setAdapter() is used to complete the final work of adaptation

.

The above is the detailed content of Spread Zhike ASP.NET Advanced Series Video Material Sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn