cancel
Showing results for 
Search instead for 
Did you mean: 

How to change Background image in sap.m.Page control

Former Member
0 Kudos

I am new to SAPUI5. I want to change the background image within sap.m.Page control but unable to do that. Please suggest how to do that. Trying with the following way to change background color:

<style type="text/css" media="all">

        .mystyle {

            background-color:#E6171A;

            color:#FFFFFF;

        }

</style>

var myTripPage = new sap.m.Page({

                            customHeader:titleBar,

                            content: [

                                      oFlexBox

                                     ],

                           footer : new sap.m.Bar({

                                          contentMiddle: new sap.m.Button({

                                                                      text :"Submit"

                                                                       })

                                                  })

                                });

myTripPage.addStyleClass('mystyle');

Similarly,even title bar color is not changing:

var titleBar = new sap.m.Bar({

                                           contentMiddle:titleLabel,

                                           contentRight: new sap.m.Image({

                                                                         src:"images/Plus.png",

                                                                         tap: function(){

                                                                         mydialog.open();

                                                                         }

                                                                         })

                                           });



Thanks

Preety

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Preety,

    I guess you can set it via CSS

.mystyle {

            background-color:#E6171A;

            color:#FFFFFF;

            background-image : url(<<URL/path of the image>>);

        }

Regards,

Tufale