728x90
CardView를 쓰면 입체감을 줄 수 있는데, 단 하나의 레이아웃만을 가질 수 있다.
아이템 전체를 CardView 로 만들려면 <LinearLayout>...</LinearLayout> 으로 모든 내용을 감싸야 한다.
Android Studio 에서 Layout 의 default 는 gone 으로 처리하고, 디자인하는 화면에서는 보이게 하고 싶을 때가 있다.
android:visibility="gone"
tools:visibility="visible"
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:id="@+id/view_business_card"
android:layout_width="match_parent"
android:visibility="gone"
tools:visibility="visible"
android:layout_height="wrap_content"
android:background="#ffffff"
android:clickable="true"
app:cardElevation="5dp"
app:cardUseCompatPadding="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</androidx.cardview.widget.CardView>
|
728x90
'안드로이드 > Layout' 카테고리의 다른 글
Material Components color (0) | 2021.08.19 |
---|---|
Shape Drawable로 간단한 배경 이미지 활용 (0) | 2021.08.12 |
android 검색 + 버튼 배치 (0) | 2021.03.14 |
하단 TabLayout + ViewPager2 Layout 예제 (0) | 2020.12.30 |
하단 TabLayout + ViewPager Layout 예제 (0) | 2020.11.01 |