본문 바로가기

커스텀

[Android] Make CustomView (TextView, OnMeasure) CustomView를 만들어 보고자 합니다.하고자 하는 것은 TextView Background 에 기본적으로 RoundRect 가 그려지도록 할 예정입니다. 여기서 필요한 기술이 두가지 입니다. 1. Background를 어떻게 그리지??2. CustomeView의 크기를 어떻게 조절하지??? 모든것을 설명해 드릴 수 없지만, 개발하는데 유용할 만한 내용은 될것이라 생각 됩니다. 먼저, Background에 이미지를 넣을때 아래와 같은 방법을 많이 씁니다. (전..그랬음.._) - FrameLayout으로 감싼 후, Background로 활용할 이미지를 ImageView에 먼저 그린 후 그 다음으로 위에 표현하고자 하는 View를 올린다. 단점 ) View의 크기가 고정 되어 있지 않으면 (예를 들어 .. 더보기
[Android] NavigationView 커스텀화 NavigationView를 커스텀화 하기에 좋은 설명이 있어서 공유하고자 글을 씁니다. itemBackground, itemIconTint and itemTextColor are simple xml-attributes that can be set, though you have to use a custom prefix instead of the android: one.Example So if you wan't to customize the color of the text (e.g. pink when unchecked and teal when checked) you should use a ColorStateList.ExampleCreate a new *.xml file in /res/color - let'.. 더보기
[ Android ] Custom NumberPicker Android Number Picker를 Custom한 디자인으로 줄려고 할 경우, Theme를 변경 시켜야 하는데 기능은 그대로 사용하고 세부적인 것을 수정할려고 하니,API에서 제공하는 함수로는 함수가 있었습니다. 그래서!!! 열심히 구글링을 해본 결과, Android 구글 소스에서 NumberPicker ( 4.2 버전 ) 을 빼와서 따로 Library화 시킨 소스가 있더라구요!License 는 Apache license 2.0!! Open source 인거죠~ ㅎ사이트 : https://github.com/SimonVT/android-numberpicker 위 소스만 가지고서는 내 마음대로 style 변경을 하기 힘듭니다.그럼 제가 Test 해본 소스를 보여드립니다. 먼저, Eclipse에서 Ap.. 더보기