-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainActivity.cs
33 lines (28 loc) · 1.02 KB
/
MainActivity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Android.App;
using Android.OS;
using Android.Support.V4.View;
using Android.Support.V7.App;
using Android.Support.V7.Widget;
namespace XamarinAndroidCarousel
{
[Activity(Label = "XamarinAndroidCarousel", MainLauncher = true, Icon = "@drawable/icon",Theme ="@style/MyTheme")]
public class MainActivity : AppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
SetSupportActionBar(toolbar);
SupportActionBar.Title = "Xamarin Android Carousel";
int[] imageList = {
Resource.Drawable.topolino,
Resource.Drawable.pippo,
Resource.Drawable.paperino,
};
var viewPager = FindViewById<ViewPager>(Resource.Id.viewPager);
ImageAdapter adapter = new ImageAdapter(this, imageList);
viewPager.Adapter = adapter;
}
}
}