我只想使用Zebble来生成UI和所有其他东西,我想使用Xamarin apis/自定义http /local db或其他任何东西。基本上,带有zebble和其他东西的UI项目将在PCL中。
它会兼容吗?你能给我一些建议吗?
发布于 2017-07-10 22:19:02
是的你可以。Zebble中没有任何东西可以阻止您直接使用原生API。
对于自定义http调用,我建议使用HttpClient类,默认情况下,在新创建的Zebble项目的所有3个平台上都可以使用该类。
对于设备API,您当然可以使用每个平台的标准API类,但为了节省时间并实现100%的代码重用,我强烈建议使用http://zebble.net/docs/device-api。例如,如果你想使用灯(也就是闪光灯、led或手电筒),你可以很容易地用很少的代码在所有平台上实现它:
// Determines if a lamp feature is available on the device.
if (await Device.Torch.IsAvailable()) { ... }
// This will switch the lamp on.
await Device.Torch.TurnOn();
// This will switch the lamp off.
await Device.Torch.TurnOff();
https://stackoverflow.com/questions/45013905
复制相似问题