Показаны сообщения с ярлыком widget. Показать все сообщения
Показаны сообщения с ярлыком widget. Показать все сообщения

NumberPicker use and customization of its appearance

Probably many of you have used widgets such as DatePicker and TimePicker. But the functionality of the widget is limited ability to choose the date and time, but I wanted more- to use this feature to select any number in a specified range (as inkontroleNumericUpDown in C #). Such a possibility exists. DatePicker widget andsystem-based TimePicker widget NumberPicker, you can not use the box. To use it you need to write a little code.

First, add NumberPicker in our main layout, xml-code is as follows:



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <com.android.internal.widget.NumberPicker
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:id="@+id/numTestNumberPicker" android:layout_centerInParent="true">
    </com.android.internal.widget.NumberPicker>
</RelativeLayout>