javascript - How to specify Ionic features look style? -
the ionic framework customizes looks of features according plataform running app, android or ios, know has third unique ionic.
my question is, there way specify how , especific feature should like? if want popovers android style , action sheets ios style, in same app, no matter platform app been build?
there has way, otherwise there wouldn't ionic style things, in example: http://codepen.io/ionic/pen/gpcst
i have tried setplatform function example without success.
$scope.setplatform = function(p) { document.body.classlist.remove('platform-ios'); document.body.classlist.remove('platform-android'); document.body.classlist.add('platform-' + p); $scope.demo = p; }
there few ways things this, should clear there limits ionic supports out of box platform specific design. when comes choosing ios specific styling 1 component , android styling another, can difficult situations.
some components have config options.
look @ http://ionicframework.com/docs/api/provider/$ionicconfigprovider/ , you'll see components can configured globally such tabs, navbars, form elements, , perhaps others in future.
you can target css modify component platform
you've seen body has platform-ios or platform-android class applied depending on device. could manually change class depending on view. however, applied body entire current view have adopt same ios or android styling. better yet, can write css override existing styles make see fit (and ionic encourages this). things possible control if modify sass variables , rebuild ionic css using sass build feature.
selectively use components
you detect platform in controllers determine if should use popover on android or action sheet ios. http://ionicframework.com/docs/api/utility/ionic.platform/ logical condition in controller first check platform, , trigger appropriate component.
that covers primary ways i've come across. can of course target own css override default values own designs disregard platform design continuity features. these covered in book ionic in action if want examples , more detail.
Comments
Post a Comment