android button设置背景图片之后无法点击
xml<Buttonandroid:id="@+id/button1"android:layout_width="wrap_content"android:layout_...
xml
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/textview"
android:background="@drawable/logon"
android:layout_centerHorizontal="true"
android:text="上传" />
java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView)findViewById(R.id.textview);
btnButton = (Button)findViewById(R.id.button1);
btnButton.setOnClickListener(new Button.OnClickListener(){
@SuppressLint("SdCardPath")
public void onClick(View v)
{
new Thread(){
@Override
public void run()
{
upload();
}
}.start();
}
});
} 展开
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/textview"
android:background="@drawable/logon"
android:layout_centerHorizontal="true"
android:text="上传" />
java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView)findViewById(R.id.textview);
btnButton = (Button)findViewById(R.id.button1);
btnButton.setOnClickListener(new Button.OnClickListener(){
@SuppressLint("SdCardPath")
public void onClick(View v)
{
new Thread(){
@Override
public void run()
{
upload();
}
}.start();
}
});
} 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询