티스토리 뷰
drawable에 아래 xml파일을 넣는다
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FFFFFF"
android:centerColor="#F1FBFF"
android:endColor="#8EC8FB"
android:angle="90"
/>
<corners
android:radius="2dp" />
</shape>
아래처럼 그라데이션 배경을 적용하고 싶은 xml 에 android:background="@drawable/그라데이션파일명" 하면된다
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_background"
android:orientation="vertical"
>
...(생략)
</LinearLayout>
결과화면(그라데이션 말고 다른 요소들은 내가 넣은것)
'공부 > Android' 카테고리의 다른 글
socket.io 사용할때 뒤로가기 눌렀을때 앱 종료되는 이유? (0) | 2022.11.07 |
---|---|
MPAndroidChart 안드로이드에서 그래프 그리기 (0) | 2022.11.03 |
안드로이드에서 socket.io 사용하기(Node.js, http, 멀티코어에서 유의점) (0) | 2022.10.29 |
안드로이드 url, api key를 숨기는법(깃 레포지토리에서^^) (0) | 2022.10.29 |
AWS EC2 서버 DB데이터 php 경유하여 안드로이드로 전송하기 (0) | 2022.09.20 |