0
그림을 사용하지 않고 원 안에 문자로 된 버튼을 만들고 싶습니다.배경 프로그램 가능한 드로어 블 자르기가
내 버튼을 다음과 같이 정의된다 :
<Button
android:id="@+id/zoomInButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="10dp"
android:background="@drawable/circle"
android:text="+"
android:textColor="@color/white"
android:textSize="62sp" />
<Button
android:id="@+id/zoomOutButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_margin="10dp"
android:background="@drawable/circle"
android:text="-"
android:textColor="@color/white"
android:textSize="62sp" />
그리고 원의 존재로 :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<stroke
android:width="3dp"
android:color="@color/white" />
<solid android:color="@android:color/transparent" />
</shape>
그러나, 원 중앙에 있지 않고 텍스트가 잘립니다 :
텍스트의 배경을 가운데에 배치하는 방법은 무엇입니까?
시도해보십시오. 'textSize' (줄이자) – kId
@kaushik 잘 작동 했으니 받아 들일 것입니다. 감사 – Antzi