我嘗試添加搜索欄,TimePicker和幾個按鈕,窗口管理器,這樣就不會有任何黃色背景或按上或拖動它,這樣 窗口管理問題
後循環圖片是否有可能? 我的代碼:
view = LayoutInflater.from(this).inflate(R.layout.edit_or_new,null);
Button button = (Button) view.findViewById(R.id.button6);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
stopSelf();
}
});
SeekBar seekBar = (SeekBar) view.findViewById(R.id.seekBar);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
Log.e("Point_1","onProgressChanged");
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
layoutParams.type = WindowManager.LayoutParams.TYPE_PHONE;
layoutParams.flags = WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
windowManager.addView(view, layoutParams);
謝謝。
這不幸的是,沒有工作。可能有另一種方法使其正常嗎?此外,我將該視圖添加到WindowManager in Service中。 – Steve
嘗試移動'setTheme(R.style.AppTheme);'到onCreate()方法,並將'WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH'改爲'WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE' –