Android 사용 으로 위 챗 채 팅 입력 상자 기능 구현
<layer-list>
라벨 은 LayerDrawable 을 설정 합 니 다.차원 이 있 는 Drawable 중첩 효과 입 니 다.각각
우 리 는 위 챗 을 실현 하 는 채 팅 입력 상 자 를 모방 합 니 다.
녹색 배경 설정 하기:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/holo_green_light" />
</shape>
</item>
</layer-list>
흰색 을 한 겹 더 겹 쳐 옆 면 녹색 라인 의 높이 를 남 깁 니 다.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/holo_green_light" />
</shape>
</item>
<item android:bottom="8dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
</shape>
</item>
</layer-list>
흰색 을 한 층 더 깔 고 설 치 된 배경 을 덮 고 바닥 과 측면의 선 을 남 깁 니 다.중간의 한 층 은 사실은 양쪽 의 녹색 선 틀 의 높이 를 남기 기 위해 서 입 니 다.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/holo_green_light" />
</shape>
</item>
<item android:bottom="8dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
</shape>
</item>
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:shape="rectangle">
<shape>
<solid android:color="@android:color/white" />
</shape>
</item>
</layer-list>
위 에서 말 한 것 은 소 편 이 소개 한 안 드 로 이 드 가
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Kotlin의 기초 - 2부지난 글에서는 Kotlin이 무엇인지, Kotlin의 특징, Kotlin에서 변수 및 데이터 유형을 선언하는 방법과 같은 Kotlin의 기본 개념에 대해 배웠습니다. 유형 변환은 데이터 변수의 한 유형을 다른 데이터...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.