1 / 5

Xamarin Training In Chennai

Xamarin is a Mobile Application Development and cross platform Development software. Greens providing free interview preparations with affordable fees.Greens Technology,the best institute for Xamarin Course in Chennai with flexible Timings.

01rakshitha
Download Presentation

Xamarin Training In Chennai

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Create ListView in Xamarin Android

  2. In this is blog I will show you how to make ListView in Xamarin Android. Step -1 Open your Android solution in Xamarin Studio. Step -2 Update your main.axml file inside your Resoursce/ Layout folder <?xml version=“1.0” encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent“> <ListViewandroid:id=”@+id/mainlistview” android:layout_height=”match_parent” android:layout_width=”match_parent“> </ListView> </LinearLayout>

  3. Step -3 public class MainActivity: Activity { string[] items; ListViewmainList; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); items = new string[] { “Xamarin”, “Android”, “IOS”, “Windows”, “Xamarin-Native”, “Xamarin-Forms” };

  4. // Set our view from the “main” layout resource SetContentView(Resource.Layout.Main); mainList = (ListView) FindViewById < ListView > (Resource.Id.mainlistview); mainList.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, items); } } Step -4 1. mainList.ItemClick += (s, e) => { 2. var t = items[e.Position]; 3. Android.Widget.Toast.MakeText(this, t, Android.Widget.ToastLength.Long).Show(); 4. };

  5. GREENS TECHNOLOGYS Xamarin is a Mobile Application Development and cross platform Development software. Greens providing free interview preparations with affordable fees. Greens Technology,the best institute for Xamarin Course in Chennai with flexible Timings.

More Related