我正在研究一個允許用戶動態添加編輯文本的android應用程序。我可以使用警報對話框添加編輯文本。但我需要使對話框透明。我需要能夠在後臺看到imageview。 Color.Transparent不會起作用,因爲我的背景是一個圖像將對話框的背景設置爲透明
0
A
回答
1
試試這個:
Dialog mDialog = new Dialog(mContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
或
我用mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
1
你可以試試這個
<EditText
android:id="@+id/purpose_textfield"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"/>
+0
看起來用戶在問關於Dialog的背景! –
+0
yepp ..問題的標題是真的讓人誤解 – peshkira
1
所迷離定製對話框在我的一個項目中。
以下是摘錄。 U可以根據自己的需要
private void ShowBluredDialog() {
// TODO Auto-generated method stub
final Dialog dialog = new Dialog(MyActivity.this);
dialog.getWindow();
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.custom);
dialog.setCancelable(false);
RelativeLayout myview=(RelativeLayout)dialog.findViewById(R.id.pauselayout);
AlphaAnimation alpha = new AlphaAnimation(0.5F, 0.5F);
alpha.setDuration(0); // Make animation instant
alpha.setFillAfter(true); // Tell it to persist after the animation ends
// And then on your layout
myview.startAnimation(alpha);
ImageButton playButton=(ImageButton)dialog.findViewById(R.id.imagePlay);
playButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
dialog.show();
}
0
而是採用警告對話框的使用,我更喜歡你使用對話框:
,並使用此代碼:
對話的對話=新的對話框(getBaseContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
相關問題
- 1. 將背景設置爲對話框
- 2. android對話框 - 設置背景圖像的不透明度
- 3. 將JPanel背景設置爲透明
- 4. Ho將JxBrowser背景設置爲透明
- 5. Cocos3d:將CC3Scene背景設置爲透明
- 6. 將SpenSurfaceView背景設置爲透明
- 7. 將jInternalFrame背景設置爲透明
- 8. 設置CGContext透明背景
- 9. 設置透明背景Win32
- 10. 設置透明背景
- 11. 設置透明背景
- 12. 爲背景設置常量半透明
- 13. 爲QWebView設置透明背景
- 14. 如何爲DataGrid設置透明背景?
- 15. WindowEx:背景顏色設置爲透明
- 16. 更改對話框背後的透明背景
- 17. 儘管透明設置爲'true',但沒有透明背景。
- 18. 我可以將QQuickFramebufferObject的背景設置爲透明嗎?
- 19. 將xul面板的背景顏色設置爲透明
- 20. 將UILabel的背景設置爲透明黑色
- 21. 如何將圖像的背景透明度設置爲0?
- 22. 如何將UIScrollView的背景設置爲透明?
- 23. 將透明度設置爲不同的彩色背景imageMagick
- 24. 爲在xml上顯示爲對話框的活動設置透明背景,但不適用於所有設備
- 25. 自定義對話框上的透明背景
- 26. 如何刪除對話框外部的透明黑色背景
- 27. android-透明背景的對話框(任何顏色)
- 28. 如何設置UITableViewCell背景不透明?
- 29. 設置在android中透明背景alertdialog
- 30. 如何設置SurfaceView背景透明
我很困惑..你想將edittext的背景設置爲透明或對話框背景嗎? –