今天学习了计算器的布局,效果图如下:
其中学习过程中出现了一小点问题,设置background属性时,发现背景颜色会覆盖掉控件的颜色,查找网上资料找到两种方法:
1.每个控件都设置它自己的背景色。
2.将背景色设置透明度,优点是简单,缺点是控件依然会带有背景色。 //因本人能力问题,本次选用第二种方法
XML代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="30dp"
android:background="#4400ccff"
>
<EditText
android:id&#