屏幕上显示的窗口
public class FlatingViewService extends Service{
public static WindowManager windowManager;
...
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
...
//Floating View Layout
li = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
myView = li.inflate(R.layout.product_response_card, null);
name = (TextView) myView.findViewById(R.id.name);
editTextName = (TextView) myView.findViewById(R.id.editTextName);
...
//Layout Parameters
...
response_card_params.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE;
Run Code Online (Sandbox Code Playgroud)
当用户尝试在editText中输入一些文本时,键盘会出现在editText的顶部.所以用户看不到任何东西.
什么是实际问题?
android window-managers android-service android-windowmanager