1
drawableleft (@ drawable/triangle.xml)를 사용하여 버튼 왼쪽에 삼각형을 그렸습니다. 그 삼각형 안에 아이콘을 놓아야합니다. 그러나 아래의 코드는 그려진 삼각형을 왼쪽으로 보여줍니다. 미리 감사드립니다삼각형 모양의 안드로이드 버튼 drawableleft 아이콘
triangle.xml 레이아웃
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<rotate
android:fromDegrees="45"
android:pivotX="13%"
android:pivotY="-38%"
android:toDegrees="45" >
<shape
android:shape="rectangle" >
<size android:width="135dp" android:height="135dp" />
<solid android:color="@color/yellow" />
</shape>
</rotate>
</item>
<item android:drawable="@mipmap/app_icon"
android:width="40dp"
android:height="40dp" />
</layer-list>
버튼 : 배경으로 그릴 수를 추가하여
<Button
android:id="@+id/sample_button"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:height="100dp"
android:background="@color/grey"
android:drawableLeft="@drawable/triangle"
android:gravity="center|left"
android:text="@string/sample"
android:textColor="@android:color/white" />
스크린 샷을 게시 할 수 있습니까? – Krish