首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >找不到Android CalendarView类

找不到Android CalendarView类
EN

Stack Overflow用户
提问于 2012-07-06 08:14:06
回答 1查看 17.5K关注 0票数 30

我正在为应用程序中使用的日历设计xml格式,但我无法让日历在图形布局淋浴中显示。

相反,我得到了以下“错误”:

找不到以下类:- CalendarView (更改为android.widget.CalendarView、Fix、Edit )

该项目的min版本为14,目标版本为15。

下面是我的XML代码:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >

        <RelativeLayout android:id="@+id/top"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
                <Button android:id="@+id/dash"
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:maxWidth="200dp"
                    android:maxHeight="10dp"
                    android:text="DASHBOARD"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:layout_alignParentLeft="true"/>

                <TextView
                    android:id="@+id/textView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:paddingBottom="10px"
                    android:paddingTop="10px"
                    android:text="Calendar"
                    android:textAppearance="?android:attr/textAppearanceLarge"/>
                <Button
                    android:id="@+id/plusButton"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:text="+"
                    android:textAppearance="?android:attr/textAppearanceLarge"/>
        </RelativeLayout>
        <CalendarView
            android:id="@+id/calview"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/top"
            android:maxHeight="300dp" />

        <RelativeLayout android:id="@+id/infoScroll"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/calview">

            <ScrollView
                android:id="@+id/scrollView1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:maxHeight="100dp">

                <ListView
                    android:id="@+id/listView1"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" >
                </ListView>

            </ScrollView>
        </RelativeLayout>
        <RelativeLayout android:id="@+id/bottomBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/infoScroll">
            <Button android:id="@+id/todayButton"
                android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:text="Today"
                android:textAppearance="?android:attr/textAppearanceSmall"/>

            <Button android:id="@+id/listButton"
                android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:layout_toLeftOf="@+id/dayButton"
                    android:text="List"
                    android:textAppearance="?android:attr/textAppearanceSmall"/>

        <Button android:id="@+id/dayButton"
                android:layout_height="wrap_content"
                    android:layout_width="wrap_content"
                    android:layout_centerInParent="true"
                    android:text="Day"
                android:textAppearance="?android:attr/textAppearanceSmall"/>

        <Button
            android:id="@+id/monthButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/dayButton"
            android:text="Month"
            android:textAppearance="?android:attr/textAppearanceSmall"/>

        <Button android:id="@+id/PeopleButton"
            android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                    android:layout_alignParentRight="true"
                android:text="People"
                android:textAppearance="?android:attr/textAppearanceSmall"/>



        </RelativeLayout>

</RelativeLayout>

非常感谢!谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-07 10:15:22

您可能在Android 16上预览屏幕。尝试使用Android 15作为图形布局编辑器(android图标位于顶部,在ADT 20中)。看起来Android Target 16有问题。

注意:您的不需要只设置图形布局编辑器中的目标。

票数 42
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11365959

复制
相关文章
Android-日历CalendarView使用
2.在主活动中 通过设置setOnDataChangeListener() 来为其添加监听事件
圆号本昊
2021/09/24
1.9K0
Android-日历CalendarView使用
Android的CalendarView控件使用及日期进行农历转换
我们在做一些日历或是对一些重要日期记录时有时会用到农历,Android里面网上可以看到一些农历的相关类,我们这里也是在度娘里找到的直接借用一下,主要是来介绍怎么使用。
Vaccae
2019/07/24
3.1K0
【Android从零单排系列十一】《Android视图控件——日历、日期、时间选择控件》
小伙伴们,在上文中我们介绍了Android视图控件ImageView控件,本文我们继续盘点,介绍一下视图控件的日历、日期、时间组件。
再见孙悟空_
2023/02/10
14.5K1
【Android从零单排系列十一】《Android视图控件——日历、日期、时间选择控件》
hbase启动找不到主类
: 错误: 找不到或无法加载主类 .Library.Java.JavaVirtualMachines.jdk1.8.0_291.jdk.Contents.Home.bin.java
yiduwangkai
2021/07/01
1.2K0
日历视图CalendarView和定时器Chronometer
上一期学习了AnalogClock、DigitalClock和TextClock时钟组件,本期继续来学习日历视图CalendarView和定时器Chronometer。 一、CalendarView 日历视图(CalendarView)可用于显示和选择日期,用户既可选择一个日期,也可通过触 摸来滚动日历。如果希望监控该组件的日期改变,则可调用CalendarView的 setOnDateChangeListener()方法为此组件的点击事件添加事件监听器。 用CalendarVie
分享达人秀
2018/02/05
2.1K0
日历视图CalendarView和定时器Chronometer
日历视图使用
CalendarView是安卓自带的一个日历控件, 可以使用其开发手机日历的相关功能.
李小白是一只喵
2020/04/24
2.6K0
悲剧!IDEA 突然找不到类了?
我们本地使用 IDEA 运行 maven 项目的时候,有时候运气不好,就会遇到某些 maven 依赖无法正常找到、导入。这就会导致 IDEA 构建项目的时候爆出一堆醒目的红色 Error。
andyxh
2021/08/06
4.9K0
Android Studio 找不到 uploadArchives 入口
在4.2之前版本的 Android Studio 中想要module 打包arr,上传Maven 我们只需要
程思扬
2023/07/10
3940
Android Studio 找不到 uploadArchives 入口
Android使用kotlin自定义plugin插件找不到类,Unable to load class
情况是这样,自定义gradle plugin,新建了一个module,并引入了groovy插件
老马的编程之旅
2022/06/22
1.4K0
Android使用kotlin自定义plugin插件找不到类,Unable to load class
hive export报错找不到DistCpOptions类
从上述报错,浏览社区没得到任何有价值的信息。通过查看hive的源码,也没有有效的信息。因此,我们需要查看hive的详细日志。
mikealzhou
2019/03/14
2.3K0
dotnet 字典类找不到 TryAdd 方法
我在给 dotnet 的 runtime 仓库提PR时,小伙伴告诉我可以使用 TryAdd 方法减少判断,但是我修改这个代码发现 100 个自动化测试都失败了,都告诉我没有找到这个方法
林德熙
2022/08/12
8660
运行jar包找不到主类
在正确编译好java程序之后,打包,然后在命令行输入java -jar ,却弹出找不到或无法加载主类。 一检查,我的path环境变量都是对的呀?java命令,程序也可以执行啊?怎么java -jar就不行了呢? 解决办法就是,修改MANIFEST文件。 然后发现,白花花的一片咧,肯定是需要添些东西的。 我打包的是名为com.ilkhome的包,里面有三个class,其中main.class是需要运行的。 于是,我在MANIFEST.MF文件里面多添加了一行:Main-Class: com
似水的流年
2018/01/18
3.9K0
运行jar包找不到主类
在正确编译好java程序之后,打包,然后在命令行输入java -jar ,却弹出找不到或无法加载主类。
似水的流年
2019/12/08
4.6K0
【Android 应用开发】Android - 时间 日期相关组件
-- CSDN :  http://download.csdn.net/detail/han1202012/6856737
韩曙亮
2023/03/27
1.3K0
【Android 应用开发】Android - 时间 日期相关组件
Date & Time组件(下)
本节我们来继续学习Android系统给我们提供的几个原生的Date & Time组件,他们分别是: DatePicker(日期选择器),TimePicker(时间选择器),CalendarView(日期视图)。
芯动大师
2023/10/13
1660
Date & Time组件(下)
【Java】idea找不到符号找不到类,但是却没有错误
友情提示:打包,先clean在package,如果为子包(被其他项目所引入包:先clean,再install)
全栈程序员站长
2022/09/13
4K0
【Java】idea找不到符号找不到类,但是却没有错误
推荐Android几个比较实用的Github开源项目
作为一个程序猿,最大的开源社区Github肯定是知道的,Android老鸟更加的不用说了,赶项目的时候肯定是去找过合适的开源控件,时间多的时候就DownLoad下源码,然后根据需求修改,这应该是最常用的方式,今天我就给大家推荐几个实用且比较火的开源项目,即使现在用不着,可以先保留着,说不定什么时候就用到了!
Rookie
2019/08/08
1.3K0
点击加载更多

相似问题

类在CalendarView类对象上找不到

10

setOnClickListener in CalendarView android

18

Android CalendarView设置事件

12

展示事件的Android CalendarView

42

定制Android CalendarView -显示DropdownMenu

11
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文