Select to view content in your preferred language

How can i figure style of pop-up in flex viewer 3.6 instead of its default  black colour

3601
2
Jump to solution
07-23-2014 06:21 AM
pracZHEN
Deactivated User

I want to change the pop-up window's background color to be the same color with my flex viewer background color, can anyone tell me how to do it?

thanks.

for now, all i have is look like pic.png , i want make is like the picWanted.png

我想将 Flex Viewer 中的 pop-up窗体的背景颜色改为和Flex Viewer中主题背景色一致,也就是说要和其他控件背景色一致,我目前的效果图见附件 pic.png ,我希望调整为picWanted.png中的效果。

请指导下,谢谢。

0 Kudos
1 Solution

Accepted Solutions
pracZHEN
Deactivated User

well, finally i find the answer to fix the question.

all i need to do is add these code to UIManager.as file.

code:start

var cssStyleDeclarationContentNavigator:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.ContentNavigator");

if (numberOfStyleColors > 4)

{

     cssStyleDeclarationContentNavigator.setStyle("headerBackgroundColor", backgroundColor);

    cssStyleDeclarationContentNavigator.setStyle("headerColor", textColor);

}

code:end

i was so close to the answer,but  i fail to get it cause my careless, next time i need to think harder.

call it a day. thanks.

View solution in original post

0 Kudos
2 Replies
pracZHEN
Deactivated User

I want to make my question more detailed。

here is the thing,i am building a program based on arcgis viewer for flex (API 3.6),in the main config file(config.xml) ,i use the code  like this below:

<operationallayers>

     <layer  label="Fires" type="feature" visible="true" alpha="1.0"
                popupconfig="popups/PopUp_Fires.xml"

</operationallayers>

and a config file for pou-up like this shown below:

to show the attribute information of the layer--http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0

and the question is the info pop-up's background color can be valued with the background color of application by some code written in the file UIManager.as :

/*Style For InfoWindow

        When pointing to graphical theme, you will need to explicitly set properties for infoWindow.

        e.g. cssStyleDeclarationInfoContainer.setStyle("backgroundColor",0xFFFFFF);

        */

        var cssStyleDeclarationInfoContainer:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow");

        /*

        For custom skin for infoWindow, borderSkin needs to be set to null as shouwn below

        infoOffsetX and infoOffsetY can be used to change the location where infowindow will be shown.

        infoPlacement would need to be set to none in this case for preventing infowindow placement from auto adjusting.

        */

        /*

        cssStyleDeclarationInfoContainer.setStyle("borderSkin",null);

        cssStyleDeclarationInfoContainer.setStyle("infoOffsetX",-45);

        */

        if (numberOfStyleColors > 4)

        {

            cssStyleDeclarationInfoContainer.setStyle("backgroundColor", backgroundColor);

            cssStyleDeclarationInfoContainer.setStyle("borderColor", textColor);

        }

        else

        {

            cssStyleDeclarationInfoContainer.setStyle("borderColor", defaultTextColor);

        }

        cssStyleDeclarationInfoContainer.setStyle("borderThickness", 1);

        cssStyleDeclarationInfoContainer.setStyle("backgroundAlpha", styleAlpha);

        topLevelStyleManager.setStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow", cssStyleDeclarationInfoContainer, false);

but there always be a black block on the top of info pop-up window which i want to change to be same with background color.the after-run picture see the attachment :question_pic.png

if anyone know about how to fix this please tell me.

thanks U for you attention .

0 Kudos
pracZHEN
Deactivated User

well, finally i find the answer to fix the question.

all i need to do is add these code to UIManager.as file.

code:start

var cssStyleDeclarationContentNavigator:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.ContentNavigator");

if (numberOfStyleColors > 4)

{

     cssStyleDeclarationContentNavigator.setStyle("headerBackgroundColor", backgroundColor);

    cssStyleDeclarationContentNavigator.setStyle("headerColor", textColor);

}

code:end

i was so close to the answer,but  i fail to get it cause my careless, next time i need to think harder.

call it a day. thanks.

0 Kudos