本文整理汇总了C#中ViewPager.SetClipToPadding方法的典型用法代码示例。如果您正苦于以下问题:C# ViewPager.SetClipToPadding方法的具体用法?C# ViewPager.SetClipToPadding怎么用?C# ViewPager.SetClipToPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewPager
的用法示例。
在下文中一共展示了ViewPager.SetClipToPadding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// Create your application here
SetContentView(Resource.Layout.ScrollImages);
var position = Intent.GetIntExtra(POSITION, 0);
viewPager = FindViewById<ViewPager>(Resource.Id.pager);
viewPager.SetClipToPadding(false);
//viewPager.PageMargin = DimensionHelper.DpToPx(12);
//More documentation is available on this page
//https://channel9.msdn.com/Series/Windows-Phone-8-Development-for-Absolute-Beginners/Part-26-Retrieving-a-Photo-from-Flickrs-API
string[] licenses = { "4", "5", "6", "7" };
string license = String.Join(",", licenses);
license = license.Replace(",", "%2C");
string url = "https://api.flickr.com/services/rest/" +
"?method=flickr.photos.search" +
"&api_key={0}" +
"&user_id={1}" +
"&format=json" +
"&page={2}" +
"&per_page={3}" +
"&nojsoncallback=1";
var baseUrl = string.Format(url,
ImageConfig.flickrApiKey,
ImageConfig.userId,
ImageConfig.page,
ImageConfig.per_page);
var client = new System.Net.Http.HttpClient ();
client.GetStringAsync (baseUrl).ContinueWith ((requestString) => {
var flickrResult = requestString.Result;
FlickrData apiData = JsonConvert.DeserializeObject<FlickrData>(flickrResult);
int counter = 0;
if (apiData.stat == "ok")
{
foreach (Photo data in apiData.photos.photo)
{
// To retrieve one photo, use this format:
//http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}{size}.jpg
counter = counter+1;
string photoUrl = "https://farm{0}.staticflickr.com/{1}/{2}_{3}_{4}.jpg";
string largeFlickrUrl = string.Format(photoUrl,data.farm,data.server,data.id,data.secret,"b");
string name = string.Format("Image{0}", counter);
items.Add(new ScrollImages(){Images=largeFlickrUrl , Activity=this});
}
}
viewPager.Adapter = new SwipeGalleryStateAdapter(SupportFragmentManager, items);
viewPager.SetCurrentItem(position, false);
});
}