Layout formatting for dialog fragment

mnayyermnayyer PKMember ✭✭

I'm showing a dialog fragment on activity. I want the layout of fragment to be transparent and using this attribute for layout which fragment loads,
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@android:color/transparent" android:layout_width="match_parent" android:layout_height="match_parent"> <com.huxq17.swipecardsview.SwipeCardsView android:id="@+id/swipeCardsView" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/transparent" app:alphaOffsetStep="20" app:scaleOffsetStep="0.08" app:yOffsetStep="20dp" /> </RelativeLayout>
But it is not creating a transparent background and the background is always white.

Another issue with another layout which is cardViewLayout which is actually loaded at @+id/swipeCardsView
`<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:background="@android:color/transparent"
android:foreground="?android:attr/selectableItemBackground"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="300dp"
android:layout_height="400dp"
card_view:cardCornerRadius="8dp"
card_view:cardElevation="3dp">



<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"

        android:id="@+id/UnitPrice"
        android:textColor="#000"
        android:padding="2dp"
        android:textSize="18sp"
        android:singleLine="true"
        android:layout_below="@id/RoomImage" />
</RelativeLayout>

</android.support.v7.widget.CardView>`

The image is always centered in card view where as I want it to be at top of cardView while I'm using this attribute android:layout_gravity="top" in <imageView....> tag as my code is attached.

Please Help.

Best Answer

Answers

Sign In or Register to comment.