Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 将按钮定位在面板内_Apache Flex - Fatal编程技术网

Apache flex 将按钮定位在面板内

Apache flex 将按钮定位在面板内,apache-flex,Apache Flex,我所要做的就是把一个按钮放在面板里面,旋转这个按钮(使它垂直),然后把它放在面板的边缘。我可以;我似乎做得不对。这是我的密码: <mx:Panel id="weekList" width="260" height="100%" x="-500" title="Weeks" > <mx:List id="weekButtonList" width="260" borderVisible="false" contentBackgroundAlpha="0"

我所要做的就是把一个按钮放在面板里面,旋转这个按钮(使它垂直),然后把它放在面板的边缘。我可以;我似乎做得不对。这是我的密码:

<mx:Panel id="weekList"  width="260" height="100%" x="-500" title="Weeks" >
        <mx:List id="weekButtonList"  width="260" borderVisible="false"  contentBackgroundAlpha="0"   dataProvider="{_data.mappoints.week.@number}" itemClick="onWeekClick(event);" >
            <mx:itemRenderer>
                <mx:Component>
                    <mx:Button  buttonMode="true" right="20" width="260" height="50" label="Week {data}"  />
                </mx:Component>
            </mx:itemRenderer>
        </mx:List>

        <mx:HBox id="closeButtonHolder" rotation="90" width="100" >
            <mx:Button  label="OPEN" click="weekListToggle()" />    
        </mx:HBox>

    </mx:Panel>


如果你看脚本的一部分,你会看到我正在尝试旋转它,并将它移到左边。我只是想把它移到某个地方,但什么都没用。另外,当我在90%的轴上旋转文本时,文本似乎消失了。有人知道我能做什么吗?

为了旋转文本,必须嵌入字体。我会四处转转,看看能否为你的另一个问题找到一个更完整的答案

好的,这里是你的一些问题

1) 你的面板的x是-500,所以它远离屏幕,也许你出于某种原因需要它,但在我的测试中,它只是被推到了视线之外

2) 旋转需要嵌入字体

3) 当您在另一个UI组件中旋转任何UI组件时,默认轴位于左上角,因此当按钮旋转时,它实际上会旋转出视图。这是不容易理解的,当你阅读它,所以这是一个视觉,考虑容器左上角为0,0在XY坐标:< /P> 正常hbox/按钮布局:

0,0_________________________________
| ________________________________ |
| |                              | | <-container outside
| |      UI component            | |
| |______________________________| |
|__________________________________|

查看按钮如何在可见区域外旋转(在您的情况下,它不再在面板上)解决方案是使用画布或其他可以让您将HBox从面板边缘拉出的东西。

使用mx:canvas并将其宽度设置为100%,如下所示:

<mx:Canvas width="100%">
  <mx:Button buttonMode="true" right="20" width="260" height="50" label="Week {data}"  />
</mx:Canvas>


我已经回答了你问题的另一部分,所以我不再重复了。

我喜欢人们在这里的反应如此之快。谢谢。+1很好的图表,很好的解释。旋转对于人们来说是一个很难理解的概念。谢谢,它还有助于理解为什么非嵌入式字体不会出现。它们在按钮内“分层”,通常是X、Y方向,然后在不移动字体的情况下旋转控件。就像在一张和平的纸上切割一个整体,然后将它移到另一个上面。
<mx:Canvas width="100%">
  <mx:Button buttonMode="true" right="20" width="260" height="50" label="Week {data}"  />
</mx:Canvas>