Getting Started with Templated Picker for Xamarin

栏目: IT技术 · 发布时间: 5年前

内容简介:As part of theThe Templated Picker in

As part of the  Telerik R1 2020 release , we released a series of pickers for Xamarin.Forms. In previous blog posts, we have reviewed theDateTime PickerandList Pickercontrols and the features they provide. It's time to get you familiarized with our Custom (Templated) Picker control.

The Templated Picker in Telerik UI for Xamarin is a control that enables you to tailor an item selection with a custom template, thus covering any potential scenario you might need for your mobile development initiative.

Getting Started with Templated Picker for Xamarin

As in the List and DateTime Pickers, its items are visualized inside a popup. The Templated Picker has a number of features that allow you to define what text will be displayed when an item from the selector is picked, fully customize what will be visualized inside the Picker’s popup and customize the popup header and footer.

In this blog post I will get you familiar with the new Templated (Custom) Picker control and the features it provides.

Templated Picker in Telerik UI for Xamarin - Key Features:

  • Selector Template : define a template for the items, as well as the selected one.
  • DisplayString Format : chose what text to display when an item from the list is picked.
  • Flexible Styling API : style the items, popup, header and footer of the picker.
  • Commands Support : commands for clearing a selected item, opening and closing the dialog. In addition the Popup exposes an Accept command that is fired when the OK button is clicked and a Cancel command that is fired when the Cancel button is clicked.

Selector Template

You can fully customize the appearance of the Templated Picker. The selector template property allows you to choose what to display in the popup after opening the Templated Picker. We also give you the option to customize the header and footer through the HeaderTemplate and FooterTemplate properties.

Our Templated Picker for Xamarin offers the useful functionality of a placeholder text. Developers can define what text is to be displayed when no item is selected, thus indicating to the end user the data they need to input, e.g. “Select color.” You can set a text using the Placeholder property or customize the default look through the PlaceholderTemplate property.

Getting Started with Templated Picker for Xamarin

You can find more about the Selector Template in the Telerik UI for Xamarin Samples TemplatedPicker/FirstLook .

DisplayString Format

The DisplayStringFormat property defines what text will be displayed when an item is selected, and you can also apply formatting to a string when an item is selected.

Flexible Styling API

You can style any part of the list picker control. Here is a list of the styling API we have exposed:

  • PlaceholderLabelStyle
  • DisplayLabelStyle

In order to style the popup, you need to use the TemplatedPicker.SelectorSetting property. The property provides the following options for styling the:

  • PopupViewStyle
  • HeaderStyle
  • HeaderLabelStyle
  • FooterStyle
  • buttons inside the footer – AcceptButtonStyle and CancelButtonStyle

Also, you have the ability to set a background color outside of the popup using the PopupOutsideBackgroundColor .

Change the text for the Popup header using the HeaderLabelText and set an icon or different text to the AcceptButtonText and CancelButtonText.

Tell Us What You Think

We would love to hear what you think about the Custom (Templated) Picker control and how we can continue to improve it. If you have any ideas for features to add, do not hesitate to share this information with us on our Telerik UI for Xamarin Feedback portal .

Don’t forget to check out the various demos of the control in our SDK Sample Browser and the Telerik UI for Xamarin  Demos application.

If you have not yet tried the Telerik UI for Xamarin suite, take it out for a spin with a 30-day free trial, offering all the functionalities and controls at your disposal at zero cost.

Start Your Trial

Happy coding with our controls! If you are curious about Date and Time pickers, don’t forget to check out our post – Getting Started with Date and Time Picker for Xamarin . Or if you need a ListPicker in your mobile application and looping functionality check out the List Picker for Xamarin blog post .


以上所述就是小编给大家介绍的《Getting Started with Templated Picker for Xamarin》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

免费

免费

克里斯•安德森 / 蒋旭峰、冯斌、璩静 / 中信出版社 / 2012-10 / 68.00元

一种商业模式既可以统摄未来的市场,也可以挤垮当前的市场——在我们这个现代经济社会里,这并不是一件不可能的事情。 “免费”就是这样的一种商业模式,它所代表的正是数字化网络时代的商业未来。 在《免费》这本书中,克里斯•安德森认为,新型的“免费”并不是一种左口袋出、右口袋进的营销伎俩,而是一种把货物和服务的成本压低到零的新型卓越能力。在20世纪“免费”是一种强有力的推销手段,而在21世纪它已经成为......一起来看看 《免费》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具