CalendarView需要很多时间,用于显示

编程入门 行业动态 更新时间:2024-10-22 13:40:06
本文介绍了CalendarView需要很多时间,用于显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的工作在CalendarView的应用程序。 我必须表明calendarView在一个小的线性布局。

i am working on an application on CalendarView. i have to show calendarView in a small linear-layout.

在显示一整页,其中包含calendarView小线性布局出现问题。 - >这需要10秒钟才能显示,和放大器;这是多少时间?

problem occurs while displaying a whole page which contains calendarView in small Linear-layout. -> this takes 10 seconds to show,& this is much time...

有布局没有任何其他东西。

there is no other thing in layout.

这里是我的XML和捕捉...

here is my xml and snap...

任何帮助将是强烈 appriciated ...

any help would be strongly appriciated...

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="schemas.android/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="30" android:paddingLeft="30dp" > <TextView android:id="@+id/txtDate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My Calendar" android:textSize="50sp" /> <View android:layout_width="fill_parent" android:layout_height="2dp" android:layout_alignParentBottom="true" android:layout_marginBottom="40dp" android:layout_marginRight="30dp" android:background="@android:color/black" /> </RelativeLayout> <RelativeLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="70" android:paddingBottom="30dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="30dp" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:orientation="vertical" > <ListView android:id="@+id/list_task" android:layout_width="fill_parent" android:layout_height="wrap_content" > </ListView> </LinearLayout> </RelativeLayout> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="30" > <CalendarView android:id="@+id/cal_small" android:layout_width="250dp" android:layout_height="250dp" android:layout_centerHorizontal="true" android:background="@android:color/darker_gray" android:showWeekNumber="false" android:animateLayoutChanges="false" android:clipChildren="false" android:drawingCacheQuality="low" android:soundEffectsEnabled="false" android:hapticFeedbackEnabled="false" /> <View android:layout_width="fill_parent" android:layout_height="2dp" android:layout_alignParentBottom="true" android:layout_marginBottom="40dp" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:background="@android:color/black" /> </RelativeLayout> <RelativeLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="70" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="30dp" android:layout_marginRight="10dp" android:layout_marginTop="30dp" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="8" > <ListView android:id="@+id/list1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="30dp" > </ListView> </LinearLayout> <ListView android:layout_width="wrap_content" android:layout_height="wrap_content" > </ListView> </LinearLayout> </RelativeLayout> </LinearLayout> </LinearLayout> </LinearLayout>

推荐答案

这似乎很简单,但一不小心我测试了这一点,它工作得很好。我希望这也将帮助你......

It seems very simple but accidentally i have tested this, and it works well. I hope this will also help you...

首先创建一个只包含CalendarView单独的XML文件。名为cal_view.xml

First create separate xml file which contains only CalendarView. Named "cal_view.xml"

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="schemas.android/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <android.widget.CalendarView android:layout_width="200dp" android:layout_height="200dp" /> </LinearLayout>

然后包括你的主XML文件此XML文件,就像下面。 而不是你的CalanderView的,包括xml文件。

Then include this xml file in to your main xml file, just like following. Instead of your CalanderView, include the xml file.

<include android:id="@+id/subCategory" layout="@layout/cal_view" />

更多推荐

CalendarView需要很多时间,用于显示

本文发布于:2023-11-26 20:12:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635026.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间   CalendarView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!