使用 Cordova 在 iOS 中显示带有外部源的图像
Display image with external source in iOS with Cordova
我想做的就是使用 Ionic/Cordova/Angular 在 iOS 模拟器中显示以下图像并将源设置为外部位置 (AWS S3):
<img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>
我尝试了以下方法:
1) 将 AmazonAWS 添加到 Cordova 的白名单中,但我很漂亮它已经被第一行覆盖了:
<access origin="*"/> <!-- existing -->
<access origin="*.amazonaws.*" /> <!-- added this -->
2) 像这样尝试完全删除协议:
<img src="miyagi-photos.s3.amazonaws.com/madeline-profile"/>
3) 尝试使用来自标准 http 协议的不同图像:
<img src="http://upload.wikimedia.org/wikipedia/en/b/b1/Portrait_placeholder.png"/>
4) 尝试使用 ng-src 而不是 src:
<img ng-src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>
整页参考:
<ion-view class="has-header" view-title="Create Class">
<ion-content>
<form>
<div>
<label for="ClassName">Class Name: </label>
<input type="text" name="name" ng-model="classInformation.name" required>
</div>
<div>
<label for="ClassPhoto">Class Photo: </label>
<div class="button" ng-file-select ng-file-change="upload($files)" ng-multiple="multiple">Select File</div>
<img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile" height="150px"/>
</div>
<div>
<label for="description">description: </label>
<input type="text" name="description" ng-model="classInformation.description" required>
</div>
<div>
<label for="rate">rate: </label>
<input type="text" name="rate" ng-model="classInformation.rate" required>
</div>
<div>
<label for="date">date: </label>
<input type="text" name="date" ng-click="setDate()" ng-model="classInformation.date" required>
</div>
<div>
<label for="time">time: </label>
<input type="text" name="time" ng-click="setTime()" ng-model="classInformation.time" required>
</div>
<div>
<label for="location">location: </label>
<input type="text" name="location" ng-model="classInformation.location" required>
</div>
<button type="submit" value="Submit" ng-click="createClass()">Create Class</button>
</form>
</ion-content>
</ion-view>
重启后问题消失Xcode。
我想做的就是使用 Ionic/Cordova/Angular 在 iOS 模拟器中显示以下图像并将源设置为外部位置 (AWS S3):
<img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>
我尝试了以下方法:
1) 将 AmazonAWS 添加到 Cordova 的白名单中,但我很漂亮它已经被第一行覆盖了:
<access origin="*"/> <!-- existing -->
<access origin="*.amazonaws.*" /> <!-- added this -->
2) 像这样尝试完全删除协议:
<img src="miyagi-photos.s3.amazonaws.com/madeline-profile"/>
3) 尝试使用来自标准 http 协议的不同图像:
<img src="http://upload.wikimedia.org/wikipedia/en/b/b1/Portrait_placeholder.png"/>
4) 尝试使用 ng-src 而不是 src:
<img ng-src="https://miyagi-photos.s3.amazonaws.com/madeline-profile"/>
整页参考:
<ion-view class="has-header" view-title="Create Class">
<ion-content>
<form>
<div>
<label for="ClassName">Class Name: </label>
<input type="text" name="name" ng-model="classInformation.name" required>
</div>
<div>
<label for="ClassPhoto">Class Photo: </label>
<div class="button" ng-file-select ng-file-change="upload($files)" ng-multiple="multiple">Select File</div>
<img src="https://miyagi-photos.s3.amazonaws.com/madeline-profile" height="150px"/>
</div>
<div>
<label for="description">description: </label>
<input type="text" name="description" ng-model="classInformation.description" required>
</div>
<div>
<label for="rate">rate: </label>
<input type="text" name="rate" ng-model="classInformation.rate" required>
</div>
<div>
<label for="date">date: </label>
<input type="text" name="date" ng-click="setDate()" ng-model="classInformation.date" required>
</div>
<div>
<label for="time">time: </label>
<input type="text" name="time" ng-click="setTime()" ng-model="classInformation.time" required>
</div>
<div>
<label for="location">location: </label>
<input type="text" name="location" ng-model="classInformation.location" required>
</div>
<button type="submit" value="Submit" ng-click="createClass()">Create Class</button>
</form>
</ion-content>
</ion-view>
重启后问题消失Xcode。