NumberPicker 示例

这是一个 NumberPicker 的简单示例,演示了如何在 Android 应用中使用 NumberPicker。

在 XML 布局文件中,我们定义了一个 NumberPicker:

    android:id="@+id/number_picker"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

在 Java 代码中,我们获取 NumberPicker 实例并设置其值:

NumberPicker numberPicker = findViewById(R.id.number_picker);
numberPicker.setValue(10);
folder
NumberPickerDemo 预估大小:1697个文件
file
MediaDescriptionCompat.aidl 683B
file
MediaMetadataCompat.aidl 680B
file
ParcelableVolumeInfo.aidl 689B
file
MediaSessionCompat.aidl 787B
file
PlaybackStateCompat.aidl 688B
file
RatingCompat.aidl 673B
file
ResultReceiver.aidl 675B
file
MainActivity.class 36KB
file
R$styleable.class 32KB
file
R$styleable.class 32KB
file
MainActivity.class 36KB
file
R$styleable.class 32KB
file
R$styleable.class 32KB
file
R$styleable.class 30KB
file
R$styleable.class 30KB
file
resources-debug.ap_ 403KB
file
resources-debug-androidTest.ap_ 1KB
file
R$styleable.class 30KB
file
resources-debug.ir.ap_ 403KB
file
1706NumberPickerDemo-debug.apk 1.81MB
zip 文件大小:14.2MB