Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9233

Re: How to add styles to image in XML view ?

$
0
0

Hi Micheal,

 

Pleas see the below code.

 

View:

 

<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"  controllerName="testing.imageXml" xmlns:html="http://www.w3.org/1999/xhtml">  <Page title="Image">  <content>  <Image id="img1" alt="alttextimage" src="images/img1.jpg" />  </content>  </Page></core:View>

 

Controller:

 

onBeforeRendering: function() {  this.getView().byId("img1").addStyleClass("myimage");  },

 

Index.html

 

                      
 

 

Output :

imageRight.JPG

 

Regards,

KK


Viewing all articles
Browse latest Browse all 9233

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>