Android:imageview和datepicker,根据datepicker输出设置图像
我开发 iPhone 应用程序已经有一段时间了。我刚刚开始使用 Android,并且已经完成了大约一半的应用程序。
我的应用程序调用本机日期选择器,用户选择日期,然后在选择日期时,特定图像以 2010-3-24 格式显示,与 android 输出相同。
我已经使用日期选择器教程来让日期选择器工作并在文本视图中显示所选文本。
我需要的是显示与所选日期相对应的特定图像。这些图像是应用程序的本地图像。我一直在寻找可能对我有帮助的教程,但到目前为止还没有这样的运气。这是一个非常简单的问题,我刚刚接触这个平台。
i have been developing iphone apps for a while now. I just started on android and have about half of my app done.
My app calls the native datepicker which the user selects the date then on the selection of the date a particular image is show in the format 2010-3-24, same as android output.
I have used the date picker tutorial to get the datepicker working and displaying the selected text in textview.
What i need is to display the particular image that corresponds to the selected date. The images are local to the app. I have looked for tutorials that would possibly help me out but so far no such luck. It is a very simple problem, i am just new to the platform.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,您将获取从 DatePicker 返回的 Date 并执行某种条件语句来确定在 ImageView 中显示什么图像。
您到底遇到什么麻烦了?您是否在确定要使用的图像的条件语句方面遇到问题?如果是这样,您需要向我们提供更多关于您希望其如何运作的信息。
您在 ImageView 中显示图像时遇到问题吗?如果是这样,请告诉我们您尝试过哪些代码,我们可以帮助您。
So you would take the Date that comes back from the DatePicker and do some sort of conditional statement to determine what image to display in an ImageView.
What exactly are you having trouble with? Are you having trouble with the conditional statement that would determine the image to use? If so you need to give us more information on how you want that to work.
Are you having trouble getting an image to display in an ImageView? If so show us what code you have tried and we can help you with that.