16
ฉันจะย่อขนาดที่ดึงได้บนปุ่มได้อย่างไร?
ฉันจะทำให้ปุ่มเล็กลงได้อย่างไร ไอคอนใหญ่เกินไปสูงกว่าปุ่มจริงๆ นี่คือรหัสที่ฉันใช้: <Button android:background="@drawable/red_button" android:drawableLeft="@drawable/s_vit" android:id="@+id/ButtonTest" android:gravity="left|center_vertical" android:text="S-SERIES CALCULATOR" android:textColor="@android:color/white" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:drawablePadding="10dp"> </Button> ส่วนบนคือลักษณะที่ควรมองตอนนี้ส่วนล่างจะดูเป็นอย่างไร ฉันลองแล้ว แต่ไม่มีภาพปรากฏขึ้น :-( Resources res = getResources(); ScaleDrawable sd = new ScaleDrawable(res.getDrawable(R.drawable.s_vit), 0, 10f, 10f); Button btn = (Button) findViewById(R.id.ButtonTest); btn.setCompoundDrawables(sd.getDrawable(), null, null, null);