我试图在警报框按钮(是和否)之间放置 20-30px 的间隙。但无法在 flex 中找到这样的样式点。我尝试过水平间隙和填充,但徒劳无功。
下面是我正在尝试的示例代码,这是我在浏览网站时发现的。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application name="Alert_style_test"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="showAlert()">
<!-- Used by the Alert control. -->
<mx:String id="message">The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.</mx:String>
<mx:String id="title">The quick brown fox jumped over the lazy dog?</mx:String>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private var a:Alert;
private function showAlert():void {
Alert.yesLabel = "Yes";
Alert.noLabel = "No";
Alert.buttonWidth = 50;
a = Alert.show(
message,
title,
Alert.NO | Alert.YES
);
/* Make the Alert form's text non-selectable. */
a.mx_internal::alertForm.mx_internal::textField.selectable = false;
}
]]>
</mx:Script>
<mx:Style>
Alert{
color : #124332;
background-color: #ffffff;
header-colors : #243322, #243322;
header-height:19;
drop-shadow-enabled: true;
drop-shadow-color :#243322;
corner-radius :6;
border-style :solid;
border-thickness: 1;
border-color : #243322;
footer-colors : #243322, #ffffff;
title-style-name : "title";
horizontal-gap:500;
horizontal-separator-skin:white;
}
.title{
font-family :Verdana;
font-size :10;
font-weight :bold;
color :#ffffff;
}
.alertButton {
letterSpacing: 0;
fontSize: 11;
cornerRadius: 10;
fontWeight: normal;
textRollOverColor: white;
color: red;
horizontal-gap:-500;
}
</mx:Style>
<!-- Click to launch Alert control. -->
<mx:Button label="Launch Alert" click="showAlert();" />
</mx:Application>