전체 화면 버튼을 투명하게 만들 수있어 사용자가 버튼을 클릭 한 위치에 관계없이 투명하게 할 수 있습니까?Android - 전체 화면 투명 버튼
다음은 버튼을 표시하고 눌렀을 때 새로운 의도를 시작하는 몇 가지 기본 Java입니다. 또한 main.xml 레이아웃을 추가했지만 버튼을 화면에 채우지 만 투명하게 업데이트하는 방법을 모르겠습니다.
는package com.MeetingManager;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
public class MeetingManager extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
layout.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent e) {
Intent myIntent = new Intent(MeetingManager.this,CreateMeeting.class);
startActivityForResult(myIntent, 0);
}
});
}
}
는 XML : 화면에 도청을 통해 사용자 상호 작용을 듣는 것은 당신의 목표 인 경우
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/meetingbg"
>
<TableRow android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/tableRow5">
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableRow>
</LinearLayout>
고마워! +1 지금 구현 중입니다. – Denoteone
위의 코드를 추가하려고하면 R.java 파일을 다시 작성하려고합니다 (불가능). 누락 된 것이 있습니까? 위의 코드를 업데이트했습니다. – Denoteone
XML에서 레이아웃에 ID를 추가하는 방법과 onTouchListener를 추가하기 전에 이것을 프로그램 방식으로 가져 오는 방법을 보여주기 위해 내 소스를 편집했습니다. 희망이 도움이 – Ljdawson