위젯 클릭시 대화 상자를 열려고합니다. android:theme="@android:style/Theme.Dialog"
으로 클릭시 시작된 활동을 스키닝하는 문제를 해결했습니다. 불행히도 나는 같은 대화 상자를 볼 수 없다.Android 액티비티를 대화 상자처럼 보이게하십시오.
, 나는 (물론, 버튼 제외)이 결과에 도달하고 싶습니다 :
(위젯 대화
이
는 결과입니다 당신은 화면을 밀고 유지 볼 수 있습니다)당신이 볼 수 있듯이 몇 가지 차이가 있습니다 : 색상 목록 항목, 텍스트의 색상 및 목록 항목 구분 기호가 포함됩니다. 표준 대화 상자와 동일한 모양을 얻기 위해 사전 정의 된 테마/스타일이 있습니까? 그렇지 않은 경우 그 결과에 도달하기 위해 따라야 할 단계는 무엇입니까?
나는 FoxyRing에서 제공하는 위젯이 갖고 싶은 행동이 있다는 것을 알았습니다. 스타일은 아이콘과와의 ListView와 일반 Theme.Light.NoTitleBar처럼 보이는 thisDialog.dismiss();
을
Context mContext = this;
Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.data_dialog);
dialog.setTitle("Your title");
AlertDialog.Builder builder;
AlertDialog alertDialog;
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.data_dialog,
(ViewGroup) findViewById(R.id.AbsoluteLayout01));
builder = new AlertDialog.Builder(mContext);
builder.setView(layout);
alertDialog = builder.create();
alertDialog.show();
final EditText txtUsername = (EditText) layout.findViewById(R.id.txtUsername);
final AlertDialog thisDialog = alertDialog;
Button btnSave = (Button) layout.findViewById(R.id.btnSave);
btnSave.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String strtxtUsername = txtUsername.getText().toString();
//do something...
}
});
이 대화 상자를 닫습니다 전화 :
예 ... 그래서 ... 내가하려고 그것은 작동 – Matroska
을 할 것 같아요. android : theme = "@ android : style/Theme.Translucent.NoTitleBar"로 액티비티를 설정 한 다음 간단한 코드를 사용하여 대화 대화 상자를 만들어 대화 취소/클릭에 대한 작업을 마무리합니다. – Matroska
당신이 원했던 방식으로 효과가 있다는 말을 듣고 기쁩니다. 건배, 반장님 – Hubert