我有一個ListArray
按鈕。不能增加按鈕列表陣列的文字大小或將它們四捨五入
我想增加按鈕的圓形和圓形(使它們具有圓角)sizetext
。我嘗試了很多方法,但是我無法修復它。
private List<Button> buttons;
private static final int[] BUTTON_IDS = {
R.id.button1,
R.id.button2,
R.id.button3,
R.id.button4,
R.id.button5,
R.id.button6,
R.id.button7,
R.id.button8,
R.id.button9,
R.id.button10,
R.id.button11,
R.id.button12,
R.id.button13,
R.id.button14,
R.id.button15,
R.id.button16,
};
和的onCreate函數I調用此函數initalised該ArrayList
public void initialbutton() {
buttons = new ArrayList<Button>();
for (int id : BUTTON_IDS) {
Button button = (Button) findViewById(id);
button.setTypeface(typeFace);
button.setTextSize(30);// this part didnt work
buttons.add(button);
}
}
,這是從數組列表
<Button
android:id="@+id/button15"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="@+id/button16"
android:layout_marginStart="8dp"
android:layout_marginTop="6dp"
android:textSize="40sp"
/>
你可以發佈你的代碼 – Anil
我編輯問題的代碼@ AnilDS –