简体   繁体   English

Xamarin.Forms在Android和IOS中分离设计

[英]Xamarin.Forms seperation of design in Android and IOS

I am a little new to Xamarin.Forms and I am trying to find a way to separate the design of each devices like Android uses Material Design and I want Android to use that and IOS use something different. 我对Xamarin.Forms有点新,我试图找到一种方法来分离每个设备的设计,如Android使用Material Design,我希望Android使用它,而IOS使用不同的东西。

I am trying to do that with Xamarin.Forms and what I know until now is that using Xaml to design the layout/storyboard, doesn't seem for me to separate it on the design for specific platform (ie Android by using support design or support widget libraries on the xaml). 我试图用Xamarin.Forms做到这一点,直到现在我所知道的是使用Xaml来设计布局/故事板,似乎我没有在特定平台的设计上分离它(即Android使用支持设计或支持xaml上的小部件库)。

Does anyone know how to say that if it is Android, use Material design or if it is IOS use another design (Maybe the OnPlatform tag would solve the issue. But it will maybe be too much?) 有谁知道怎么说如果它是Android,使用Material设计或者如果它是IOS使用另一种设计(也许OnPlatform标签可以解决问题。但它可能会太多了?)

Thanks! 谢谢!

You can set the Material design in AndroidManifest.xml like this: 您可以在AndroidManifest.xml设置Material设计,如下所示:

<application 
  android:icon="@drawable/appicon" 
  android:label="Your app" 
  android:theme="@style/Theme.Material.Light">
</application>

This will only apply the design on Android devices since Material design and AndroidManifest.xml are not available on iOS. 这仅适用于Android设备上的设计,因为iOS上没有Material design和AndroidManifest.xml

I found the answer on Xamarin Blog. 我在Xamarin Blog上找到了答案。 https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/ https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/

Posted yesterday :P Thanks for answers! 昨天发表:P谢谢你的回答! It helped a lot. 它帮助了很多。 Now I just miss on how to do it on IOS. 现在我只想念如何在IOS上做到这一点。 but I guess it will maybe be simpler now. 但我想现在可能会更简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM