我正在尝试使用登录表单(用户/密码文本输入+ 1按钮)实现一个简单的页面.我想将这种形式修复到离子含量的底部.但它不起作用.
HTML:
<ion-view hide-nav-bar="true">
<ion-content padding="true">
<img class="logo" src="img/logo.jpeg" />
<div class="login-form">
<div class="list">
<label class="item item-input light-text-input">
<input type="text" placeholder="user" ng-model="user">
</label>
<label class="item item-input light-text-input">
<input type="text" placeholder="password" ng-model="password">
</label>
</div>
<div class="row">
<div class="col">
<button class="button button-block button-energized">Login</button>
</div>
<div class="col">
<button class="button button-block button-positive">FB Login</button>
</div>
</div>
<p class="text-center"><a href="#/app/forgot-password">Forgot password</a></p>
</div>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
我想设置为"修复"div.login-form.
使用以下CSS不起作用:
{
position: fixed;
bottom: 20px;
}
Run Code Online (Sandbox Code Playgroud)
此外,有位置:固定输入文本似乎不再可编辑.
在Ionic中,是否可以将部分内容固定到底部?谢谢!
我对离子和科尔多瓦来说很新.我想以某种方式得到用户的电话号码,这可能吗?我正在尝试为我的应用创建号码注册.当用户第一次要求他输入通过短信获得的代码时,用户打开应用程序.它类似于viber.第一个视图包含一个"向我发送代码"按钮,下一个视图的形式为"输入代码:"和一个"登录我"按钮.
我非常喜欢我能做到的,ionic upload并立即将我的应用程序放在我的iPhone上!
但我该怎么调试呢?我在Windows上,我发现的所有选项都需要在OSX上.
1)Safari 6远程调试 - 用于Windows的Safari已停止在5.1
2)XCode - nope,在windows上
3)ionic emulate ios -l -c -s 不,在窗户上
我有一台Mac在待机状态下通过vs-mda-remoteVisual Studio Cordova Tools的服务监听构建请求,因此我可以构建和部署到这样的实时设备,但这非常耗时.
如果这是以某种方式与离子视图集成
ionic upload -l -c -s
Run Code Online (Sandbox Code Playgroud)
我的生活将会完整.好吧好吧也许我们现在可以没有现场重装,但它有可能吗?
为了澄清,我知道离子服务,但我正在谈论使用IonicView移动应用程序调试电话.我有一个问题,只能通过IonicView应用程序在手机上发生,但无法在浏览器中复制.
cordova ionic-framework visual-studio-cordova ionic ionic-view
我正在开发一个IONIC应用程序,我已经检查过用户是否已经登录,如果用户已经登录,那么应用程序应该重定向到仪表板上.此功能运行良好,但应用程序首先显示登录页面几秒钟,然后重定向到仪表板.
app.js
$rootScope.$on("$locationChangeStart", function (event, next, current) {
var prefs = plugins.appPreferences;
prefs.fetch('iuserid').then(function (value) {
if (value != '') {
$state.go('app.dashboard');
}
});
.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
controller: 'AppCtrl'
})
.state('login', {
url: "/login",
templateUrl: "templates/login.html",
controller: 'LoginCtrl'
})
.state('app.dashboard', {
url: "/dashboard",
views: {
'menuContent': {
templateUrl: "templates/dashboard.html",
controller: 'DashboardCtrl'
}
}
})
;
// if none of the above states are matched, use this as the …Run Code Online (Sandbox Code Playgroud) 情况:
我正在开发一个从API接收数据的Ionic应用程序.
之前,API在http://地址上,一切正常.
然后我们将API移动到https://并且它不再起作用了.或者,它仍然可以在浏览器中访问它,但不能在手机(或模拟器)中访问它.
我不确定可能是什么问题.在控制台日志中,我看到请求的状态为0.
它可能与白名单,标题或CORS有关.我尝试了几种方法但没有效果.
白名单:
在config.xml之前有这个白名单:
<allow-navigation href="http://*/*" />
Run Code Online (Sandbox Code Playgroud)
我曾尝试以多种方式修改它,但这并没有解决问题.例如,我尝试过:
<allow-navigation href="https://*/*" />
Run Code Online (Sandbox Code Playgroud)
和
<allow-navigation href="*" />
Run Code Online (Sandbox Code Playgroud)
API请求:
这是API请求的一个示例:
$http.get( 'https://MY_DOMAIN.com/mobile/list_mobile_project/' ,{},{"headers" : {"Content-Type" : "application/x-www-form-urlencoded; charset=UTF-8" }})
.success(function(data, status, headers, config)
{
// code
}).
error(function(data, status, headers, config)
{
console.log('Error with the API list_mobile_project');
console.log(data);
console.log(status);
console.log(headers);
console.log(config);
});
Run Code Online (Sandbox Code Playgroud)
API响应:
这是API响应的一个例子:
public function list_mobile_project()
{
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
// code
echo json_encode( $project_list );
}
Run Code Online (Sandbox Code Playgroud)
问题:
如何让API在HTTPS上运行?
如果是与CORS相关的问题,如何在服务器端启用它?
我在我的项目中完成了Angularjs拖放方法.我在拖放方面没有任何问题,但是我在下一步操作后如何为可拖动元素制作样式时遇到了问题.
对于我的情况,如果用户将Goose和Rabbit拖到标有分娩的动物的框中,则用户将单击" 检查答案 "按钮.将有正确的或错误的每个draggble格以上符号.
我尝试检查元素,但我只看到这些样式:
[ng-drag] {
width: 50px;
height: 50px;
background: rgba(255, 255, 255, 0.5);
color: #131313;
text-align: center;
padding-top: 12px;
display: inline-block;
margin: 5px 5px;
cursor: move;
border: 1px solid #ccc;
border-radius: 4px;
}
Run Code Online (Sandbox Code Playgroud)
的NG-拖动指示施加到每个可拖动的元件.我如何区分每个元素并使其成为个性化风格?这件事让我很困惑,需要你们所有人的帮助.谁能帮我?
我真的很感激任何建议或帮助.
我的预期产量:
片段供您参考:
var myApp = angular.module('MyApp',['ngDraggable']).controller('MyCtrl',function($scope){
$scope.checkAnswer = function()
{
}
$scope.centerAnchor = true;
$scope.toggleCenterAnchor = function () {
$scope.centerAnchor = !$scope.centerAnchor
};
var onDraggableEvent = function (evt, data) { …Run Code Online (Sandbox Code Playgroud)在我的Angular应用程序中(我的版本是4.3.1)我在多行之后添加了一个CSS省略号.
为此,我在Sass中使用以下css代码.
.ellipsis {
-webkit-box-orient: vertical;
display: block;
display: -webkit-box;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
Run Code Online (Sandbox Code Playgroud)
出于某种原因,盒子方向线只是通过变换从样式中移除,导致省略号不起作用.这似乎发生在Angular和Ionic应用程序中.
在ion-back-button不现身的右边ion-menu-button。这是为什么?
在ion-menu-button和ion-title显示正确,并在相同的位置horizantal对齐。
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<!-- navigation button-->
<ion-menu-button></ion-menu-button>
<!-- optional back button-->
<ion-back-button></ion-back-button>
</ion-buttons>
<ion-title>
{{ pageTitle | translate}}
</ion-title>
</ion-toolbar>
</ion-header>
Run Code Online (Sandbox Code Playgroud)
在 DOM 检查器中, 的 CSSdisplay属性ion-back-button设置为none。为什么它会设置为none?
我用了
this.navCtrl.navigateForward('/term/' + term);
Run Code Online (Sandbox Code Playgroud)
导航到此页面,因此我希望后退按钮可以选择它。为什么navigateForward不添加到堆栈中,这会使ion-back-button显示?
我已经从 Ionic 4 升级到 Ionic 5,现在出现以下错误:
src/app/app.component.ts(4,10) 中的错误:错误 TS2305:模块 '"/node_modules/@ionic/angular/ionic-angular"' 没有导出成员 'Events'。
以下导入行导致问题:
import { Events, Platform } from '@ionic/angular';
Run Code Online (Sandbox Code Playgroud)
如何从@ionic/angularIonic 5 中的错误修复成员事件?
以下是我采取的步骤
我收到以下错误
ERROR in src/app/pages/main/main.page.html:1:1 - error NG8001: 'ion-header' is not a known element:
1. If 'ion-header' is an Angular component, then verify that it is part of this module.
2. If 'ion-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
1 <ion-header>
~~~~~~~~~~~~
src/app/pages/main/main.page.ts:5:16
5 templateUrl: './main.page.html',
~~~~~~~~~~~~~~~~~~ …Run Code Online (Sandbox Code Playgroud)