我不得不承认我对移动开发知之甚少,但经过一些研究后,似乎xamarin和ionic是使用.net进行跨平台移动开发的两种流行框架.虽然我不是他们中的任何一个l.
我想知道使用Xamarin从前到后和使用离子与.net web api作为后端之间的主要区别是什么?当然,xamarin不是游离的,而离子是.
我有一个错误代码1000,如果我从我的照片库中选择一个图像与cordova插件cordova-plugin-file 3.0.0(android).我不知道错误代码1000测量什么.如果我拍一张新照片,一切正常.
有人有想法吗?
function optionsForType(type) {
var source;
switch (type) {
case 0:
source = Camera.PictureSourceType.CAMERA;
break;
case 1:
source = Camera.PictureSourceType.PHOTOLIBRARY;
break;
}
return {
destinationType: Camera.DestinationType.FILE_URI,
sourceType: source,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
}
function saveMedia(type) {
var deferred = $q.defer();
var options = optionsForType(type);
$cordovaCamera.getPicture(options).then(function(imageUrl) {
var name = imageUrl.substr(imageUrl.lastIndexOf('/') + 1);
var namePath = imageUrl.substr(0, imageUrl.lastIndexOf('/') + 1);
var newName = makeid() + name;
console.log(newName, cordova.file.dataDirectory);
$cordovaFile.copyFile(namePath, name, cordova.file.dataDirectory, newName)
.then(function() { …Run Code Online (Sandbox Code Playgroud) android android-camera ionic-framework cordova-plugins ionic
我有一个索引页面,其中包含3个选项卡.问题出现在所有选项卡中,但我将在此处显示主页.发生的问题是主页的一些顶部内容被标题栏和标签栏重叠,因此它被隐藏.
在Home html页面的内部,我试图用离子内容包装代码(参见下面的代码),但这隐藏了顶级内容,调整了高度,它不再是全屏,加上幻灯片我必须刷过来内容因为如果我触摸一些填充或边距空间它将不再滑动(幻灯片3是一个很好的例子,因为它没有很多内容,你必须按下并在文本上滑动才能刷卡).如果我删除了离子内容标签,这会正确调整高度,使滑动工作,所以我不必刷内容使其工作,但顶部内容的问题仍然被标签和标题栏重叠存在.如何将home.html完美地放在标签下并利用所有空间?
的index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- ngCordova install script needed -->
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js --> …Run Code Online (Sandbox Code Playgroud) 非常感谢你们在很多方面帮助我们的所有教程.请问,虽然我是角度/离子新手,但我手头有问题需要解决.
1)我有一个表格,其中包含几个输入来收集个人信息,如姓名,性别,DOB,职业等.在表格的底部,我有图像标签和一个按钮分别显示和捕捉图像.我能够捕获并显示捕获的图像.
问题陈述:
1)我想将所有个人信息(包括捕获的图像)保存在本地存储中.为什么?因为网络不好
2)我想检索保存的信息和图像并上传到远程服务器.
如果你能用你想要的简单而简短的教程来说明这一点,我将非常感激.再次感谢.
我正在寻找在Netbeans上使用Ionic Framework的任何方法.我在GitHub找到了一个项目:https://github.com/hexaviewtech/ionic-netbeans-plugin但我无法安装它.
我在这里关注如何安装插件浏览到下载的IonicExtention文件,然后单击OK按钮此文件IonicExtension不存在.
我如何为NetBeans安装IonicExtension?
我正在使用离子ion-slide-box控制来显示几个图像。每个图像都有不同的高度。我正在努力将这些幻灯片内的图像垂直居中。现在,整个幻灯片都与顶部对齐:
<ion-slide-box>
<ion-slide>
<img src="../../img/article1.png">
</ion-slide>
<ion-slide>
<div style="height: 100%">
<img src="../../img/article111.png">
</div>
</ion-slide>
<ion-slide>
<img src="../../img/article1111.png">
</ion-slide>
</ion-slide-box>
Run Code Online (Sandbox Code Playgroud) 这有效,但它无法向下滚动到最底部.我在底部有主页按钮,很少有项目被它阻挡,不会向上滚动.主页按钮位于主页面的页脚中,而不是在同一个控制器上.我如何确保在底部看到所有图片.对任何建议表示赞赏.
<ion-scroll direction='y' zooming='true' style="height: 1024px">
<div class="favorites list item item-text-wrap" ng-repeat="photo in favorites">
<a class="item item-thumbnail-left" href="#">
<img src="sourceURL</p>
</a>
</div>
</ion-scroll>
Run Code Online (Sandbox Code Playgroud) 我有一个使用Ionic(Cordova和Angular)构建的iOS应用。我的应用程序的版本1(已经发布了一段时间)使用HTML5 localStorage存储了一些数据。我准备发布版本2,但更新应用程序(我已经通过xcode,itunes和testflight安装进行了模拟)会擦除存储在localstorage中的所有数据。
看来localstorage db存储在Library / Caches /中,如果有帮助的话。
有关信息,我正在使用:
科尔多瓦3.9.2和离子1.1.1
在花了整整一天时间搜索SO和其他各个网站之后,我仍然不明智。
有办法防止这种情况吗?有兴趣听到在发行的cordova应用程序上使用localStorage的任何人的消息。
$ ionic add ionic-platform-web-client
Failed to find the bower component "ionic-platform-web-client".
Are you sure it exists? (CLI v1.7.12)
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.2.1
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS
Node Version: v4.2.2
Run Code Online (Sandbox Code Playgroud)
我尝试了以下命令,没有其他stackoverflow问答中的建议.
bower install --allow-root --save-dev ionic-platform-web-client
Run Code Online (Sandbox Code Playgroud)
当我在mac中尝试时也是同样的问题.附上了错误信息.
ionic add ios
Failed to find the bower component "ios".
Are you sure it exists? (CLI …Run Code Online (Sandbox Code Playgroud) 我有一个firebase Auth工厂如下
app.factory("Auth", ["$firebaseAuth", "FIREBASE_URL","$ionicPlatform",
function($firebaseAuth, FIREBASE_URL, $ionicPlatform) {
var auth = {};
$ionicPlatform.ready(function(){
var ref = new Firebase(FIREBASE_URL);
auth = $firebaseAuth(ref);
});
return auth;
}
]);
Run Code Online (Sandbox Code Playgroud)
我在我的ui-router解决方案中注入Auth工厂作为依赖关系但是在配置ui-router时,auth是空的,因为平台准备就绪后开始.
app.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('menu', {
url: '/menu',
abstract:true,
cache: false,
controller: 'MenuCtrl',
templateUrl: 'templates/menu.html',
resolve: {
auth: function($state, Auth){
//<--Auth is empty here when the app starts ----->
return Auth.$requireAuth().catch(function(){
$state.go('login'); //if not authenticated send back to login
});
}
}
})
Run Code Online (Sandbox Code Playgroud)
如何确保Auth工厂在注入ui-router之前不为空?
我试过这个 -
app.factory("Auth", ["$firebaseAuth", "FIREBASE_URL","$ionicPlatform",
function($firebaseAuth, FIREBASE_URL, …Run Code Online (Sandbox Code Playgroud) ionic-framework ×10
ionic ×7
angularjs ×3
android ×2
css ×2
cordova ×1
firebase ×1
html ×1
ionic-view ×1
ios ×1
javascript ×1
mobile ×1
netbeans ×1
xamarin ×1