【问题标题】:GWT MenuBar SubMenuBar alignGWT 菜单栏子菜单栏对齐
【发布时间】:2013-07-02 11:06:44
【问题描述】:

我的问题是我有一个带有子菜单栏的菜单栏(见图 1),即使没有空间,它也总是在右侧打开。 所以我的问题是如何更改弹出位置? 我需要弹出窗口像 pic.2 中一样

这就是现在的样子:

它应该是这样的:

我以某种方式读到这个问题在当前的 gwt 版本中没有得到修复,暂时修复它的唯一方法是在创建点后不久捕获弹出宽度/高度并使用偏移量更改位置。这是真的?

感谢您的帮助:)

【问题讨论】:

    标签: java gwt menubar


    【解决方案1】:

    尝试给 CSS 如下:

    MenuBar manageMenuBar = new MenuBar(true);
    manageMenuBar.setStyleName("dropdownMenu");
    
    
    .dropdownMenu {
        background-clip: padding-box;
        background-color: #FFFFFF;
        border: 1px solid #CCCCCC;
        border-radius: 6px 6px 6px 6px;
        box-shadow: 0 5px 10px #CCCCCC;
        float: right;
        left: -126px; // This will set the position of the menubar at left by 126px.
        list-style: none outside none;
        margin: -6px -18px -20px -5px;
        min-width: 120px;
        padding: 5px 0;
        position: absolute;
        z-index: 1000;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 1970-01-01
      • 2021-01-07
      • 1970-01-01
      • 2014-08-10
      • 2013-09-21
      相关资源
      最近更新 更多