我附上了2张照片。 iPhone 6图片是正确的,应该在所有设备中显示。每个页面都应显示第1张图像(iPhone6的图像)中的页面。它在iPhone 5(附图像),Android设备和平板电脑中变得歪曲
HTML代码(使用AngularJS和离子)
<ion-view >
<ion-nav-title>
<div class="trip-title">Trips</div>
</ion-nav-title>
<ion-content class="aaaaa">
<ion-tabs class="tabs-striped tabs-top tabs-background-dark tabs-color-energized">
<ion-tab title="PAST TRIPS" ui-sref="previous" on-select="onPreviousTabSelected()">
<ion-nav-view name="previous"></ion-nav-view>
</ion-tab>
<ion-tab title="UPCOMING TRIPS" ui-sref="future" on-select="onFutureTabSelected()">
<ion-nav-view name="future"></ion-nav-view>
</ion-tab>
</ion-tabs>
<div class="triprepeat" ng-repeat="item in items| orderBy : '-tripDate'">
<div class="div-box-trip">
<img class="cartrip" src="http://www.irantravelservice.com/images/icon/car.png" alt="Custom Image"/>
<span><div class="date-trip">{{item.starRating}}, {{item.tripDate}}</div></span>
<span><div class="bookingidtitle-trip">Booking Id : </div></span>
<span><div class="bookingid-trip">{{item.tripId}}</div></span>
<span>
<div class="starttime-trip">{{item.tripStartTime}}</div>
<div>
<img class="arrowright-trip" src="http://worldconflictsresearch.t83.net/communities/8/004/013/145/338//images/4621747970_179x256.png" alt="Custom Arrow Image"/>
</div>
</span>
<span>
<div class="source-trip">{{item.sourceLocation}}</div>
<div>
<img class="greencircle-trip" src="http://stavangerkarateklubb.no/wp-content/uploads/2016/05/grønn.png" alt="Custom Red Circle"/></div>
</span>
<span><div class="dashed-trip"><hr class="dashtrip"/></div></span>
<span>
<div class="dest-trip">{{item.destinationLocation}}</div>
<div><img class="redcircle-trip" src="http://107.6.178.147/wp360/wordpress/wp-content/uploads/2016/04/red.png" alt="Custom Red Circle"/></div>
</span>
</div>
</div>
</ion-content>
CSS代码
.view-container .scroll-content.ionic-scroll.has-header.aaaaa {
background-color: #ffffff;
}
.cartrip{
max-width: 40px !important;
margin-top: 15px;
margin-left: 20px;
}
.triprepeat{
background-color: #f1f1f1;
border-bottom: solid 1.5px #B2B2B2;
margin-left: 15px;
margin-right: 15px;
margin-top: 10px;
margin-bottom: 10px;
}
.date-trip{
margin-left: 80px;
margin-right: auto;
margin-top: -50px;
font-size: 12px;
color: #000000;
}
.div-box-trip{
height: 120px;
width: auto;
}
.bookingidtitle-trip{
margin-left: 80px;
margin-top: 8px;
font-size: 11px;
color: #A9A9A9;
}
.bookingid-trip{
margin-left: 160px;
margin-right: auto;
margin-top: -20px;
font-size: 12px;
color: #000000;
}
.starttime-trip{
margin-left: 250px;
margin-right: auto;
margin-top: -48px;
font-size: 12px;
}
.arrowright-trip{
height: 15px;
width: auto;
position: absolute;
margin-top: -18px;
margin-left: 315px;
}
.source-trip{
margin-left: 80px;
margin-top: 40px;
font-size: 12px;
color: #000000;
}
.dest-trip{
margin-left: 280px;
margin-top: -32px;
font-size: 12px;
color: #000000;
}
.greencircle-trip{
height: 15px;
width: 15px;
margin-left: 85px;
}
.redcircle-trip{
height: 15px;
width: 15px;
margin-left: 295px;
}
.dashtrip{
border-top: dotted 1px;
width: 170px;
}
.dashed-trip{
margin-left: 110px;
margin-top: -10px;
}
我正在通过两张图片展示某些设备的页面是如何变形的,比如说代码适用于iPhone 6但是因为iPhone5而变得扭曲。此页面适用于所有移动设备和平板电脑
我必须让它适用于像iPhone6这样完美运行的所有设备。由于此页面仅限移动版,因此我没有使用@Media查询。
答案 0 :(得分:0)
考虑使用专门为开发响应式网格布局而创建的ionic 2 grid system。
在你的情况下,你需要像
这样的东西System.InvalidOperationException: 'No such configuration property: "max.request.size"'
要获得额外的保证金和填充,您可以添加部分ionic 2 css utilities,而不是撰写自己的<ion-grid>
<ion-row>
<ion-col col-2>
Left Side
</ion-col>
<ion-col col-10>
Right side
</ion-col>
</ion-row>
</ion-grid>
。
css