मेरे खींचने योग्य फ़ोल्डर में
Cardeviewborder.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorAccent"/>
<stroke android:width="3dip" android:color="#B1BCBE" />
<corners android:radius="20dip"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>
लेआउट फ़ोल्डर में
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@android:color/white"
android:layout_height="wrap_content"
android:padding="10dp">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="4dp"
android:layout_gravity="center"
android:background="@drawable/cardviewborder"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/listitemtaskname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="25sp"
android:textStyle="bold"
tools:text="Hi" />
<TextView
android:id="@+id/listitemdatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="15sp"
tools:text="By" />
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
कार्डव्यू बॉर्डर नहीं बदलता है। मैं क्या गलत कर रहा हूं और मैं चाहता हूं कि कार्डव्यू रिलेटिवलेआउट से ऊपर उठे लेकिन वह भी एलिवेशन एट्रीब्यूट जोड़ने के बाद भी नहीं होता है। कृपया मदद करें मैं चाहता हूं कि मेरा कारव्यू बॉर्डर के साथ कुछ इस तरह दिखे छवि विवरण यहां दर्ज करें
2 जवाब
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/listitemtaskname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="25sp"
android:textStyle="bold"
tools:text="Hi" />
<TextView
android:id="@+id/listitemdatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:textSize="15sp"
tools:text="By" />
</LinearLayout>
</android.support.v7.widget.CardView>
सापेक्ष लेआउट को हटाकर जांचें, कार्डव्यू ऊंचा हो जाएगा।
CardView
की ऊंचाई को प्रभावित किए बिना आपको CardView
की पृष्ठभूमि बदलने के लिए app:cardBackgroundColor
का उपयोग करना चाहिए।
यदि आप इस संपत्ति का उपयोग करते हैं तो आप CardView की ऊंचाई खो देंगे: android:background
संबंधित सवाल
नए सवाल
android
एंड्रॉइड Google का मोबाइल ऑपरेटिंग सिस्टम है, जिसका उपयोग प्रोग्रामिंग या डिजिटल डिवाइस (स्मार्टफोन, टैबलेट, ऑटोमोबाइल्स, टीवी, वियर, ग्लास, IoT) को विकसित करने के लिए किया जाता है। एंड्रॉइड से संबंधित विषयों के लिए, एंड्रॉइड-विशिष्ट टैग जैसे कि एंड्रॉइड-इरादे, एंड्रॉइड-गतिविधि, एंड्रॉइड-एडॉप्टर आदि का उपयोग करें। विकास या प्रोग्रामिंग के अलावा अन्य प्रश्नों के लिए, लेकिन एंड्रॉइड फ्रेमवर्क से संबंधित हैं, इस लिंक का उपयोग करें: https: // android.stackexchange.com।