有安卓的NumericUpDown按钮? [英] Android having NumericUpDown Button?

查看:375
本文介绍了有安卓的NumericUpDown按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到的NumericUpDown按钮在Android中,但未能成功。你知道什么是控制器称为Android的 - 请让我知道

I've tried to find the NumericUpDown button in Android, but failed. Do you know what the controller is called in Android - please let me know!

<?xml version="1.0" encoding="utf-8"?>
<!-- 
 main.xml 
 7/22 2010 
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 >
 <GridView 
  android:id="@+id/GridView" 
  android:layout_width="fill_parent"  
  android:layout_height="fill_parent"
  android:numColumns="3"
  android:verticalSpacing="10dp"
  android:horizontalSpacing="10dp"
  android:columnWidth="90dp"
  android:stretchMode="columnWidth"
  android:gravity="center"
  android:background="@color/white"
  >
 </GridView>
 <ButtonUpDown>
  <!-- The real name is??? -->
 </ButtonUpDown>
</LinearLayout>

感谢名单为您的时间 修改

Thanx for your time

控制器看起来是这样的:

The controller looks like this:

推荐答案

你有你的截屏视图看上去喜欢 com.android.iternal.widget.NumberPicker 这是所使用的一些标准的部件,诸如<一个href="http://developer.android.com/reference/android/widget/DatePicker.html"><$c$c>DatePicker.

The view you have on your screenshot looks likes com.android.iternal.widget.NumberPicker which is used by some of the standard components, such as DatePicker.

不幸的是,这个组件并不意味着给公众使用 - 因此内部包名。有<一href="http://stackoverflow.com/questions/523510/is-there-a-view-for-inputing-integers-in-android">some招数,你可以用它来得到它,但我建议不要直接访问它。由于这是c中的API维护者私人$ C $不会担心不同版本的Andr​​oid外部的兼容性,所以,即使你能得到现在的工作,它可能会导致在未来的问题。

Unfortunately, this component is not meant for public use - hence the internal in the package name. There are some tricks you can use to get to it, but I would recommend against accessing it directly. As this is "private" code the API maintainers aren't going to worry about external compatibility in different versions of Android, so even if you can get it working now it will probably cause your problems in future.

您最好的选择是<一个href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/NumberPicker.java">get在$ C $下 NumberPicker 从公开的Andr​​oid源代码库,然后剪切并粘贴到自己的类来创建你的电话号码选取器插件。

Your best bet is to get the code for NumberPicker from the public Android source repository and cut and paste it in to your own class to create your Number Picker widget.

或者,如果你不想自己做,工作拉 NumberPicker 从源头已经完成,并在网站上发布供您下载和使用

Or if you didn't want to do this yourself, the work to pull NumberPicker from the source has already been done and posted on a website for you to download and use.

这篇关于有安卓的NumericUpDown按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆