2012-07-06 10 views
29

मैं एक ऐप में इस्तेमाल होने वाले कैलेंडर के लिए एक्सएमएल प्रारूप को डिज़ाइन नहीं कर सकता, लेकिन मैं कैलेंडर को ग्राफ़िकल लेआउट शॉवर में दिखाने के लिए नहीं प्राप्त कर सकता।एंड्रॉइड कैलेंडरव्यू क्लास

निम्नलिखित वर्गों नहीं पाया जा सका:

इसके बजाय मैं निम्नलिखित 'त्रुटि' प्राप्त - CalendarView (android.widget.CalendarView को बदलें,, एक्सएमएल संपादित पथ का निर्माण फिक्स)

इस परियोजना के लिए न्यूनतम SDK संस्करण 14 है और अपने लक्ष्य संस्करण 15.

कोड है यहाँ मेरी एक्सएमएल है:

<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> 

बहुत सराहना की! धन्यवाद!

+0

अगर आपके मुद्दे को हल किया गया तो एक उत्तर के रूप में चिह्नित करें :) –

उत्तर

42

आप एंड्रॉइड लक्ष्य 16 पर अपनी स्क्रीन का पूर्वावलोकन कर रहे हैं। ग्राफिक लेआउट संपादक (शीर्ष पर एंड्रॉइड आइकन, एडीटी 20 में) के लिए एंड्रॉइड लक्ष्य 15 का उपयोग करने का प्रयास करें। ऐसा लगता है कि एंड्रॉइड लक्ष्य 16 के साथ समस्या है।

नोट: आप को ग्राफ़िकल लेआउट संपादक में केवल लक्ष्य लक्ष्य को सेट करने की आवश्यकता नहीं है।

+1

आपके उत्तर ने मुझे यह विश्वास करने से बचाया कि मैं किसी कारण से डेटपिकर तत्व का उपयोग नहीं कर सका। मैंने सोचा "डेटपिकर क्लास नहीं मिल सकता है ??", और फिर मुझे यह पोस्ट मिला। डेटपीकर बस ठीक काम करता है। एक बार फिर धन्यवाद। – LargeGlasses

संबंधित मुद्दे