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

Need view or scrollview depending on platform

$
0
0

I have a container (currently a view) that needs to be a scrollview if running on android. Rather than create 2 controls with platform specific tags like the following:

<View id="container" platform="ios">
//Lots of children controls
</View>
<ScrollView id="container" platform="android">
//Lots of children controls
</ScrollView>
I thought I have seen a way in alloy to reference a commonjs module that can return a ui control. So hopefully I can just call one module, perhaps a commonJS file that would return the correct UI control. Something like:
<Require src="viewByPlatform">
//Lots of children controls
</Require>
And in the viewByPlatform file it would either be an xml file or possible a commonJS file that returns a view or scrollview depending on platform. Is something like this currently possible?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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