我正在使用 Flash Builder 4 高级版。我的应用程序有一个我不想滚动的标题栏,下面的一个组应该滚动。这是我希望能够滚动的组:
<s:Scroller id="scrlMemberManager" includeIn="MemberManager" y="79" width="100%" height="100%" creationComplete="memberManagerInit()">
<s:Group id="grpMemberManager">
<s:Rect top="0" left="0" width="100%" height="100%">
<s:fill>
<s:SolidColor color="#bdbec0" />
</s:fill>
</s:Rect>
<s:Panel id="pnlCenterMembers" width="597" height="444" x="10" y="5" title="Center Members">
<s:Panel x="7" y="9" width="259" height="388" title="Create Member" dropShadowVisible="false">
<s:TextInput x="71" y="11" width="164" id="txtCenterNewMemName" creationComplete="setUpTabKey(txtCenterNewMemName, null, txtCenterNewMemEmail)"/>
<s:Label x="6" y="18" text="Name" width="60" textAlign="right"/>
<s:TextInput x="71" y="41" width="164" id="txtCenterNewMemEmail" creationComplete="setUpTabKey(txtCenterNewMemEmail, txtCenterNewMemName, cboCenterNewMemGroup)"/>
<s:Label x="6" y="48" text="Email" width="60" textAlign="right"/>
<s:ComboBox x="71" y="71" width="164" id="cboCenterNewMemGroup" creationComplete="{ newMemGroup_creationCompleteHandler(event); setUpTabKey(cboCenterNewMemGroup, txtCenterNewMemEmail, null); }" textAlign="center" dataProvider="{getCenterGroupNamesResult.lastResult}" />
<s:Button x="165" y="101" label="Create" click="createUser('Center')" id="btnCenterCreateNewMem"/>
<s:Label x="6" y="78" text="Group" width="60" textAlign="right"/>
</s:Panel>
<s:Panel x="274" y="10" width="314" height="388" title="Member List" dropShadowVisible="false" id="pnlCenterMemberList">
<mx:DataGrid x="10" y="10" width="294" height="275" id="grdCenterMemberList" dataProvider="{getCenterMembersResult.lastResult}" allowMultipleSelection ="true" dragEnabled="false">
<mx:columns>
<mx:DataGridColumn headerText="Member Name" dataField="username"/>
</mx:columns>
</mx:DataGrid>
<s:Button x="10" y="295" label="Add To / Rem From Group" width="140" id="btnCenterAssignToGroup" click="assignMemberToGroup('Center')" fontSize="9"/>
<s:Button x="10" y="324" label="Change Password" width="140" id="btnCenterChangePassword" click="changePassword('Center')" visible="false"/>
<s:Button y="295" label="Delete" width="140" id="btnCenterDeleteMember" click="deleteMember_clickHandler(event)" right="9"/>
</s:Panel>
</s:Panel>
<s:Panel id="pnlOnlineMembers" width="597" height="444" x="627" y="5" title="Our Online Members">
<s:Button y="-26" id="btnSwitchOnlineMembers" label="Show All Online Members" width="170" right="7" click="switchOnlineMembers()"/>
<s:Panel x="7" y="9" width="259" height="388" title="Create Member" dropShadowVisible="false">
<s:Label x="6" y="18" text="Name" width="60" textAlign="right"/>
<s:Label x="6" y="48" text="Password" width="60" textAlign="right"/>
<s:Label x="6" y="108" text="Email" width="60" textAlign="right"/>
<s:Label x="6" y="138" text="Group" width="60" textAlign="right"/>
<s:Label x="6" y="71" text="Confirm Password" width="60" textAlign="right"/>
<s:TextInput x="71" y="11" width="164" id="txtOnlineNewMemName" creationComplete="setUpTabKey(txtOnlineNewMemName, null, txtOnlineNewMemPassword1);"/>
<s:TextInput x="71" y="41" width="164" id="txtOnlineNewMemPassword1" displayAsPassword="true" creationComplete="setUpTabKey(txtOnlineNewMemPassword1, txtOnlineNewMemName, txtOnlineNewMemPassword2);"/>
<s:TextInput x="71" y="71" width="164" id="txtOnlineNewMemPassword2" displayAsPassword="true" creationComplete="setUpTabKey(txtOnlineNewMemPassword2, txtOnlineNewMemPassword1, txtOnlineNewMemEmail);"/>
<s:TextInput x="71" y="101" id="txtOnlineNewMemEmail" width="164" creationComplete="setUpTabKey(txtOnlineNewMemEmail, txtOnlineNewMemPassword2, cboOnlineNewMemGroup);"/>
<s:ComboBox x="71" y="131" width="164" textAlign="center" id="cboOnlineNewMemGroup" dataProvider="{getCenterGroupNamesResult.lastResult}" creationComplete="setUpTabKey(cboOnlineNewMemGroup, txtOnlineNewMemEmail, null);" />
<s:Button x="165" y="160" label="Create" id="btnOnlineCreateNewMem" click="createUser('Online')"/>
</s:Panel>
<s:Panel x="274" y="10" width="314" height="388" title="Member List" dropShadowVisible="false">
<mx:DataGrid x="10" y="10" width="294" height="275" id="grdOnlineMemberList" dataProvider="{onlineMembersArray}" allowMultipleSelection="true">
<mx:columns>
<mx:DataGridColumn headerText="Member Name" dataField="username"/>
</mx:columns>
</mx:DataGrid>
<s:Button x="10" y="295" label="Add To / Rem From Group" width="140" id="btnOnlineAssignToGroup" click="assignMemberToGroup('Online')" fontSize="9"/>
<s:Button x="10" y="324" label="Change Password" width="140" id="btnOnlineChangePassword" click="changePassword('Online')" visible="false"/>
<s:Button x="163" y="295" label="Add To Our Center" width="140" id="btnOnlineAssignToCenter" click="assignMemberToCenter()" visible="false"/>
<s:Button x="163" y="295" label="Remove From Center" width="140" id="btnOnlineRemoveFromCenter" click="removeMemberFromCenter()"/>
</s:Panel>
</s:Panel>
<s:Button right="10" bottom="10" label="Admin Manager" id="btnAdminManager" visible="false" click="{ goToAdminManager(); }" creationComplete="{if (currentUserRights[center] == 'OWNER' || currentUserRights[center] == 'SUPERUSER') btnAdminManager.visible = true;}"/>
</s:Group>
</s:Scroller>
乍一看,一切似乎都很好,但是如果您将屏幕缩小到必须滚动的位置,则背景颜色不会填充整个滚动条,只会填充在您开始滚动之前最初显示的部分,因此您会得到看起来像这样的东西:
我不确定解决此问题的最佳方法是什么,但我想我可以调整背景颜色 Rect 的大小以匹配滚动条宽度......如果我能找出滚动条宽度是多少。滚动条宽度是指它包含的内容的宽度,而不是其视口的宽度(希望我的术语是正确的)。有没有办法找到那个宽度,或者有更好的方法吗?每个面板的宽度都设置好了,但是窗口的大小可能会超出内容的宽度,所以我要确保背景填满用户的窗口(当然不包括标题栏),无论它们的大小是多少窗户群岛