Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Center align image view inside a view

$
0
0

I'm trying to create a header banner in a screen with some color and to add an image to that banner horizontally centre aligned.

I'm getting the image left aligned, Is there any option for aligning it to the center of the banner without using left, right properties so that it will be in the center in all devices with different resolutions.

In xml file,

<View id="headerBanner" class="header">
            <ImageView id="headerImage" image="/android/images/bannerImage.png" />
        </View>
and in tss file,
".header": {
    layout: 'horizontal',
    backgroundColor: "#0B610B",
    height: Ti.UI.SIZE,
    width: Titanium.Platform.displayCaps.platformWidth,
    top : 0
},
 
"#headerImage": {
 
},
which property of headerImage can make it center aligned. Thanks!

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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