GVKun编程网logo

用户切换浏览器选项卡时如何从JApplet隐藏JDialog?(js隐藏浏览器地址栏)

4

在这篇文章中,我们将带领您了解用户切换浏览器选项卡时如何从JApplet隐藏JDialog?的全貌,包括js隐藏浏览器地址栏的相关情况。同时,我们还将为您介绍有关29FlutterDialogAler

在这篇文章中,我们将带领您了解用户切换浏览器选项卡时如何从JApplet隐藏JDialog?的全貌,包括js隐藏浏览器地址栏的相关情况。同时,我们还将为您介绍有关29 Flutter Dialog AlertDialog 、SimpleDialog、showModalBottomSheet、showToast、AlertDialog中的Android选项卡、android – 每次单击选项卡时如何刷新tabhost选项卡内容?、android-如何从片段显示BottomSheetDialog?的知识,以帮助您更好地理解这个主题。

本文目录一览:

用户切换浏览器选项卡时如何从JApplet隐藏JDialog?(js隐藏浏览器地址栏)

用户切换浏览器选项卡时如何从JApplet隐藏JDialog?(js隐藏浏览器地址栏)

问题:用户从小程序开始长时间操作;显示带有进度条的JDialog。用户打开/切换到另一个浏览器选项卡-仍然显示JDialog(并惹恼用户)。

当用户切换到另一个选项卡时,JDialog应该被隐藏;并在用户切换回时再次显示。

注意:我看到了类似问题的问题,解决方案是添加windowActivated /
deactivated监听器。它对我不起作用,因为窗口中有多个框架,其中一个框架包含applet。当用户单击另一个框架时,将强制执行windowDeactivate事件,但用户仍在同一选项卡中。

29 Flutter Dialog AlertDialog 、SimpleDialog、showModalBottomSheet、showToast

29 Flutter Dialog AlertDialog 、SimpleDialog、showModalBottomSheet、showToast

pubspec.yaml

fluttertoast: ^3.1.3

 

Dialog.dart

import ''package:flutter/material.dart'';
import ''package:fluttertoast/fluttertoast.dart'';

class DialogPage extends StatefulWidget {
  DialogPage({Key key}) : super(key: key);

  _DialogPageState createState() => _DialogPageState();
}

class _DialogPageState extends State<DialogPage> {
  _alertDialog() async {
    var result = await showDialog(
        context: context,
        builder: (context) {
          return AlertDialog(
            title: Text(''提示信息''),
            content: Text(''你确定要删除吗?''),
            actions: <Widget>[
              FlatButton(
                child: Text(''取消''),
                onPressed: () {
                  print(''取消'');
                  Navigator.pop(context, "Cancle");
                },
              ),
              FlatButton(
                child: Text(''确定''),
                onPressed: () {
                  Navigator.pop(context, "Ok");
                  print(''确定'');
                },
              )
            ],
          );
        });
    print(result);
  }

  _simpleDialog() async {
    var result = await showDialog(
        context: context,
        builder: (context) {
          return SimpleDialog(
            title: Text("选择内容"),
            children: <Widget>[
              SimpleDialogOption(
                child: Text("Option A"),
                onPressed: () {
                  print("Options A");
                  Navigator.pop(context, "A");
                },
              ),
              Divider(),
              SimpleDialogOption(
                child: Text("Option B"),
                onPressed: () {
                  print("Options B");
                  Navigator.pop(context, "B");
                },
              ),
              Divider(),
              SimpleDialogOption(
                child: Text("Option C"),
                onPressed: () {
                  print("Options C");
                  Navigator.pop(context, "C");
                },
              )
            ],
          );
        });
    print(result);
  }

  _modelBottomSheet() async {
    showModalBottomSheet(
        context: context,
        builder: (context) {
          return Container(
            height: 220,
            child: Column(
              children: <Widget>[
                ListTile(
                  title: Text("分享 A"),
                  onTap: () {
                    print("分享 A");
                    Navigator.pop(context, "A");
                  },
                ),
                Divider(),
                ListTile(
                  title: Text("分享 B"),
                  onTap: () {
                    print("分享 B");
                    Navigator.pop(context, "B");
                  },
                ),
                Divider(),
                ListTile(
                  title: Text("分享 C"),
                  onTap: () {
                    print("分享 C");
                    Navigator.pop(context, "C");
                  },
                )
              ],
            ),
          );
        });
  }

  _toast() async {
    Fluttertoast.showToast(
      msg:''提示信息'',
      toastLength: Toast.LENGTH_SHORT,
      gravity: ToastGravity.CENTER,
      timeInSecForIos: 3,
      backgroundColor: Colors.black87,
      textColor: Colors.white,
      fontSize: 16.0
    );
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(''Dialog''),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
              child: Text(''alert弹出框-AlertDialog''),
              onPressed: _alertDialog,
            ),
            SizedBox(height: 20),
            RaisedButton(
              child: Text(''select弹出框-SimpleDialog''),
              onPressed: _simpleDialog,
            ),
            SizedBox(height: 20),
            RaisedButton(
              child: Text(''ActionSheet弹出框-showModalBottomSheet''),
              onPressed: _modelBottomSheet,
            ),
            SizedBox(height: 20),
            RaisedButton(
              child: Text(''toast-fluttertoast第三方库''),
              onPressed: _toast,
            ),
          ],
        ),
      ),
    );
  }
}

 

AlertDialog中的Android选项卡

AlertDialog中的Android选项卡

我可以在AlertDialog中有选项卡吗?

我已经阅读了很多在线教程,并且通常将意图从一种活动转移到另一种活动中.但是,警报对话框都在单个活动中.

我想在一个警报对话框中有两个选项卡.

解决方法:

Can I have tabs in AlertDialog?

大概您可以在AlertDialog中使用TabHost和TabWidget,使用选项卡的视图.此示例显示活动中的“选项卡视图”:https://github.com/commonsguy/cw-omnibus/tree/master/WidgetCatalog/Tab在您的情况下,您将使用相同的布局,但使用LayoutInflater创建视图,然后将其与AlertDialog.Builder一起使用以创建对话框.

I’ve gone through a lot of online tutorials and they usually place the intent from one activity to another in the tabs.

这些教程现在已经过时了恕我直言.在选项卡中嵌入活动的整个技术已被弃用.

android – 每次单击选项卡时如何刷新tabhost选项卡内容?

android – 每次单击选项卡时如何刷新tabhost选项卡内容?

我有tabhost有3个标签.

歌曲名单,新歌和最爱

在每个标签中,我的内容都是linearlayout.在linearlayout里面我有listview.

这是我的代码..

 @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootView = inflater.inflate(R.layout.fragment_fragment_one, container, false);

        TabHost host = (TabHost) rootView.findViewById(R.id.tabHost);
        host.setup();

        dbHelper = new FragmentOne_DbAdapter(getActivity());
        dbHelper.open();
        //Clean all data
        //dbHelper.deleteallPlayer1();
        //Add some data
        dbHelper.insertPlayer1Songlist();
        //Generate ListView from sqlite Database

        //Tab 1
        TabHost.TabSpec spec = host.newTabSpec("SONG LIST");
        spec.setContent(R.id.tab1);
        spec.setIndicator("SONG LIST");
        host.addTab(spec);

        listView = (ListView) rootView.findViewById(R.id.slPlayer1ListView);
            player1ESearch = (EditText) rootView.findViewById(R.id.player1Search);
            ImageButton dplayer1ESearch=(ImageButton) rootView.findViewById(R.id.delete);
            dplayer1ESearch.setonClickListener(new View.OnClickListener() {
                public void onClick(View v) {
                    player1ESearch.setText("");
                }
            });
            displayPlayer1ListView();

        //Tab 2
        spec = host.newTabSpec("NEW SONGS");
        spec.setContent(R.id.tab2);
        spec.setIndicator("NEW SONGS");
        host.addTab(spec);

            listViewNew = (ListView) rootView.findViewById(R.id.slPlayer1NewListView);
            displayPlayer1NewListView();

        //Tab 3
        spec = host.newTabSpec("FAVORITES");
        spec.setContent(R.id.tab3);
        spec.setIndicator("FAVORITES");
        host.addTab(spec);

        return rootView;
    }

    private void displayPlayer1ListView() {
        Cursor cursor = dbHelper.fetchAllPlayer1();

        FragmentOneAdapter = new FragmentOne_Adapter(getActivity(), cursor, 0);
        listView.setAdapter(FragmentOneAdapter);

        player1ESearch.addTextChangedListener(new TextWatcher() {

            public void afterTextChanged(Editable s) {
            }

            public void beforeTextChanged(CharSequence s, int start,
                                          int count, int after) {
            }

            public void onTextChanged(CharSequence s, int start,
                                      int before, int count) {
                FragmentOneAdapter.getFilter().filter(s.toString());
            }
        });

        FragmentOneAdapter.setFilterQueryProvider(new FilterQueryProvider() {
            public Cursor runQuery(CharSequence constraint) {
                return dbHelper.fetchPlayer1ByTitle(constraint.toString());
            }
        });
    }

    private void displayPlayer1NewListView() {
        Cursor cursor = dbHelper.fetchAllPlayer1New();
        FragmentOneAdapterNew = new FragmentOne_AdapterNew(getActivity(), cursor, 0);
        listViewNew.setAdapter(FragmentOneAdapterNew);
    }

每次单击选项卡时,如何刷新选项卡内容?

在我的第一个标签SONG LIST中,

我更新了一些数据字段,

然后当我查看NEW SONGS标签时,

更新应出现在列表中..

我需要的只是在每次单击“新歌”选项卡时调用查询或刷新页面.这样它就会重新加载和更新内容.

谢谢!

解决方法:

实际上问题是您的活动已经呈现,在您的情况下,您希望每当列表上的用户选项卡刷新您的项目.
您可以通过以下方式执行此操作:

1)覆盖类中的OnResume()方法,而不是在此生命周期方法中添加获取和更新UI的项的代码.

2)在设置选项卡时添加tabhost Intent.FLAG_ACTIVITY_CLEAR_TOP.

  i.e
  tabHost.addTab(tabHost.newTabSpec("tab1")
    .setIndicator("First Text")
    .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
    .setContent(new Intent(this, class1.class)));

android-如何从片段显示BottomSheetDialog?

android-如何从片段显示BottomSheetDialog?

与片段中的supportFragmentManager等效的是childFragmentManager。那是用于任何类型DialogFragment的正确FragmentManager。

今天关于用户切换浏览器选项卡时如何从JApplet隐藏JDialog?js隐藏浏览器地址栏的讲解已经结束,谢谢您的阅读,如果想了解更多关于29 Flutter Dialog AlertDialog 、SimpleDialog、showModalBottomSheet、showToast、AlertDialog中的Android选项卡、android – 每次单击选项卡时如何刷新tabhost选项卡内容?、android-如何从片段显示BottomSheetDialog?的相关知识,请在本站搜索。

本文标签: