我有一个按钮,如下所示:
<Button
android:text="Submit"
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</Button>
在我的onCreate()
项赛事中,我这样称呼Button01:
setContentView(R.layout.main);
View Button01 = this.findViewById(R.id.Button01);
Button01.setOnClickListener(this);
应用程序中有一个背景,我想在这个提交按钮上设置一个不透明度.如何设置此视图的不透明度?这是我可以在java端设置的,还是可以在main中设置的.xml文件?
在java端,我try 了Button01.mutate().SetAlpha(100)
,但它给了我一个错误.