當前位置:編程學習大全網 - 網站源碼 - android 用表格布局做壹個計算器 因為按鈕上符號有長短 怎麽讓button 都壹樣大

android 用表格布局做壹個計算器 因為按鈕上符號有長短 怎麽讓button 都壹樣大

兩種方法:

1、設置按鈕固定寬度,但不建議

2、設置按鈕寬度為wrap_content,並設置layout_weight等分剩下的空間。

如:

android:layout_width="wrap_content"

android:layout_weight="1"/>

android:layout_width="wrap_content"

android:layout_weight="1"/> //所以同壹行的按鈕的layout_weight都設置同壹個數值,起到等分剩下空間的作用。這樣按鈕就壹樣大了。

android:layout_width="wrap_content"

android:layout_weight="1"/>

  • 上一篇:Linux下如何安裝配置DNS,DHCP,FTP,IIS,WWW服務器?
  • 下一篇:綜合考評成績是什麽?
  • copyright 2024編程學習大全網