[안드로이드] 툴바 텍스트 가운데 정렬하기!!
프로그래밍/안드로이드2017. 11. 11. 00:40
반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ff5c00"> <TextView android:id="@+id/txv_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="TOOLBAR" android:textColor="#ffffff" android:textSize="20sp" /> </android.support.v7.widget.Toolbar> | cs |
위와 같이 툴바에 텍스트를 넣고 가운데 정렬을 해보면 약간 우측으로 정렬 되는데요
아래와 같이 툴바에 app:contentInsetStart="0dp" 옵션을 추가 하면 가운데 정렬을 할수 있습니다
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:contentInsetStart="0dp" android:background="#ff5c00"> <TextView android:id="@+id/txv_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:text="TOOLBAR" android:textColor="#ffffff" android:textSize="20sp" /> </android.support.v7.widget.Toolbar> | cs |
반응형
'프로그래밍 > 안드로이드' 카테고리의 다른 글
안드로이드 - TO DO(할일 목록) 추천 앱!! (0) | 2017.11.20 |
---|---|
[안드로이드] 비트맵 이미지 사이즈 간단히 줄이기(늘리기)!! (0) | 2017.11.18 |
[안드로이드 추천앱] 편리한 TV 편성표 확인 앱!! (0) | 2017.07.11 |
추천앱! 실시간 환율 정보를 손쉽게 확인하는 앱! (1) | 2017.06.13 |
[안드로이드] EditText 엔터키로 키보드 내리기(숨기기) (1) | 2017.06.11 |