【问题标题】:Action mode partly hidden by status bar动作模式被状态栏部分隐藏
【发布时间】:2015-07-02 19:43:51
【问题描述】:

我正在尝试使用支持库中的新材料设计 AlertDialogs。

我有一个案例,我在 AlertDialog 中有一个 EditText。 在该 EditText 中,如果我长按选择文本,则操作栏会出现在屏幕顶部,其中包含全选、剪切和复制按钮。

我遇到的问题是操作栏被Android状态栏部分隐藏,使我无法选择剪切或复制按钮。

如何使操作栏不被部分隐藏并可供使用?

我可以通过在 Android Studio 中创建一个新项目并将此代码写入 onCreate 方法来重现此问题:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    EditText et = new EditText(this);
    et.setText("Hello world");

    AlertDialog.Builder b = new AlertDialog.Builder(this);
    b.setTitle("Test");
    b.setPositiveButton("OK", null);
    b.setView(et);
    b.create().show();
}

这是我在模拟器中得到的结果:

【问题讨论】:

  • 我今天用较新的 appcompat-v7 版本 22.2.1 对此进行了测试,问题仍然存在。

标签: android android-actionbar android-support-library android-actionmode androiddesignsupport


【解决方案1】:

看起来这是 appcompat-v7 中的一个错误,已在 Android M 版本的库中解决。

这里是错误的链接:https://code.google.com/p/android/issues/detail?id=170105

【讨论】:

    猜你喜欢
    • 2014-10-30
    • 1970-01-01
    • 2014-11-29
    • 2014-01-29
    • 2011-04-29
    • 1970-01-01
    相关资源
    最近更新 更多