나는 미친 알약을 복용하고 있을지 모르지만 실제적으로 오류 스키닝을받은 사람이 있습니까? 나는 미친 짓을하지 않고 TextInput (spark)을 확장하고 errorSkin 속성을 설정합니다.errorSkin Spark TextInput 유효성 확인
나는 SparkSkin을 사용하여 스킨을 만들려고했지만 아무 것도하지 않았습니다. ProgrammaticSkin을 사용하여 스킨을 만들려고했지만 아무것도하지 않았습니다.
텍스트 입력은 항상 빨간색 테두리입니다. errorColor와 errorString을 설정할 수 있다는 것을 알고 있지만, 분명히 테두리의 색을 변경하는 것 이상의 것을하기를 바라고 있습니다. Flex 4.1을 사용하여 컴파일 중입니다.
아이디어가 있으십니까?
도 구현 :
<components:PromptedTextInput id="txt"
width="200"
horizontalCenter="0"
verticalCenter="0"
errorSkin="skins.TestSkin" />
클래스
public class PromptedTextInput extends TextInput
{
public function PromptedTextInput()
{
super();
}
}
오류 피부 :
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Metadata>
<![CDATA[
[HostComponent("spark.components.TextInput")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
<s:State name="error" />
</s:states>
<!-- fill -->
<s:Rect id="background"
left="1" right="1" top="1" bottom="1">
<s:fill>
<!--- Defines the background fill color. -->
<s:SolidColor id="bgFill"
color="#66CC66" />
</s:fill>
</s:Rect>
</s:SparkSkin>
또 다른 오류 피부 시도 :
public class TestSkin extends ProgrammaticSkin
{
public function TestSkin()
{
super();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
graphics.clear();
graphics.beginFill(0x33CC33);
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.endFill();
}
}
errorSkin이 대체 스킨 인 경우; 색깔있는 배경 이상을 필요로하지 않습니까? ErrorSkin을 TextInput 스킨의 복사본으로 다시 만들어보십시오. – JeffryHouser