티스토리 뷰
<클릭시 원본>
1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0" encoding = "utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_wdith="match_parent"> <gradient android:angle="" android:type="linear" android:startColor="" android:centerColor="" android:endColor=""/> </shape> | cs |
1. drawable 폴더에 bg.xml생성
2. 위의 코드를 작성
3. angle = 각도 (45의 배수만 들어가는 듯함)
startColor, centerColor, endColor = 시작,중간, 끝 색상 (중간색상은 생략 가능)
4. 그라디언트 배경을 사용할 뷰에서
1 2 | android:background="@drawable/bg" | cs |
속성을 적는다.
이미지를 때려박는 방식보다 이 방식이 더 빠르고 좋다고 하니 애용하도록 하자.
'배운 것 > 안드로이드' 카테고리의 다른 글
[안드로이드] jsoup를 이용한 네이버 실검 파싱하기 (7) | 2017.08.10 |
---|---|
안드로이드 .jar파일 라이브러리 추가 (0) | 2017.08.07 |
안드로이드 레퍼런스 목록 (0) | 2017.07.03 |
안드로이드 클립보드에 텍스트를 복사시키기 (0) | 2017.07.03 |
안드로이드 타이틀 바 제거하기 (0) | 2017.03.26 |
댓글