導航:首頁 > 操作系統 > androidprocessbar

androidprocessbar

發布時間:2024-12-13 18:54:19

1. android創建dialog時如何去掉模糊的背景

有函數啊 可以查查啊

例如:
一:控制Dialog 的背景方法:1.定義一個無背景主題主題<!--去掉背景Dialog-->
<style name="NobackDialog"
parent="@android:style/Theme.Dialog">
<item
name="android:windowBackground">@color/no_back</item>
</style>
2.創建Dialog
dialog = new Dialog(this,R.style.dialog);
dialog.setContentView(R.layout.dialog_loading);

or:
dialog = new Dialog(this,R.style.NobackDialog);
LayoutInflater mInflater = LayoutInflater.from(this);
View dialogProcessBar =
mInflater.inflate(R.layout.dialog_loading,null);
dialog.setView(dialogProcessBar,0, 0, 0, 0);

二:控制Dialog 以及內部控制項的背景方法:
dialog = new Dialog(this,R.style.dialog);
WindowManager.LayoutParams lp=dialog.getWindow().getAttributes();
// 模糊度getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
dialog.getWindow().setAttributes(lp);
lp.alpha=0.5f;(0.0-1.0)//透明度,黑暗度為lp.dimAmount=1.0f;

三:去掉邊框、title 等參數
<resources>
<style name="dialog" parent="@android:style/Theme.Dialog">
<item
name="android:windowFrame">@null</item><!--邊框-->
<item
name="android:windowIsFloating">true</item><!--是否浮現在activity之上-->
<item
name="android:windowIsTranslucent">false</item><!--半透明-->
<item name="android:windowNoTitle">true</item>
<item
name="android:background">@android:color/black</item>
<item name="android:windowBackground">@null</item>
<item
name="android:backgroundDimEnabled">false</item><!--模糊-->
</style>
</resources>

2. 【Android開發】如何 使得 android長按按鈕=多次按下按鈕

項目遇到需要實現按鍵點擊同時,如果按住也能實現連續音量加的效果

本辦法是通過按下標志開啟線程固定間隔時間發送動作

重寫setOnTouchListener事件

  1. btn_bolumeup.setOnTouchListener(newOnTouchListener(){

  2. @Override
  3. publicbooleanonTouch(Viewv,MotionEventevent)
  4. {
  5. Log.d("yj.chen","onTouch");
  6. if(event.getAction()==MotionEvent.ACTION_DOWN){
  7. Log.d("yj.chen","ACTION_DOWN");
  8. longClicked=true;
  9. btn_bolumeup.setBackgroundResource(R.drawable.haier_pop_btn_nor_m);//
  10. Threadt=newThread(){
  11. @Override
  12. publicvoidrun(){
  13. super.run();
  14. while(longClicked)
  15. {
  16. sendcode=24;
  17. sendkeyenvet();
  18. try{
  19. Thread.sleep(250);
  20. }catch(InterruptedExceptione){
  21. e.printStackTrace();
  22. }
  23. Log.d("yj.chen","runend");
  24. }
  25. }
  26. };
  27. t.start();
  28. }elseif(event.getAction()==MotionEvent.ACTION_UP){
  29. btn_bolumeup.setBackgroundResource(R.drawable.touch_control_btn);//touch_control_btnhaier_pop_btn_sel_m
  30. longClicked=false;
  31. Log.d("yj.chen","ACTION_UP");
  32. }
  33. returntrue;
  34. }
  35. });
閱讀全文

與androidprocessbar相關的資料

熱點內容
北侖二級壓縮螺桿機 瀏覽:44
加密路線免費入口 瀏覽:739
計算器程序員是幹嘛的 瀏覽:362
數控編程里fo是啥鍵 瀏覽:655
javacdataxml 瀏覽:943
本機tcp伺服器地址 瀏覽:426
切換pdf 瀏覽:92
iturns下載的app在哪裡 瀏覽:641
雲起書院App在哪裡 瀏覽:615
怎麼對hex文件進行加密 瀏覽:285
pdf少年時 瀏覽:953
兩個同名文件夾同步 瀏覽:630
拍照文件夾哪個好用 瀏覽:91
文件夾和書包 瀏覽:511
解壓歸檔拿登記證 瀏覽:225
去體驗解壓房 瀏覽:613
單片機一鍵中斷響應 瀏覽:646
唐浩明pdf 瀏覽:845
程序員土木 瀏覽:73
android如何與web伺服器交互 瀏覽:611