0

when i try to add a shadow to my cardView .. it works but only with a small width of card like below

enter image description here

so when i make the widht equal to 272dp and that what i want, the corners have no shadow like so

enter image description here

and this is my code! can anybody help?! & thank you too much :)

<LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="horizontal">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_alignParentBottom="true"
                            android:clipToPadding="false"
                            android:clipChildren="false"
                            android:layout_height="wrap_content"
                            android:orientation="vertical"
                            >

                            <TextView
                                android:id="@+id/textView7"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:paddingLeft="17dp"
                                android:text="Available in" />

                            <androidx.cardview.widget.CardView
                                android:layout_width="160dp"
                                android:layout_height="58dp"
                                android:layout_gravity="center"
                                android:cardElevation="10dp"
                                android:layout_margin="8dp"
                                />

                        </LinearLayout>
                    </LinearLayout>
ILii
  • 83
  • 3
  • 10
  • Why do you have a Linear Layout inside another Linear Layout? – MehranB Dec 17 '20 at 19:28
  • i have a lot of other elements inside one horizantal liner layout and so! just to make the design tidy i did it this way – ILii Dec 17 '20 at 20:53
  • Give a time on this stack: https://stackoverflow.com/questions/43406938/cardview-not-showing-shadow-elevation/43407250 – Apps Maven Jan 14 '21 at 04:06

0 Answers0