[英]Ionic Angular ion-content Padding Issue
I am working on my first Ionic app. 我正在开发我的第一个Ionic应用程序。 I started with the basic sidemenu template. 我从基本的sidemenu模板开始。
$ ionic start myApp sidemenu
From there I created a simple page with a list, it looks like this... 从那里我创建了一个带有列表的简单页面,它看起来像这样......
<ion-view view-title="Players">
<ion-nav-buttons side="right">
<button class="button button-positive" ng-click="doSomething()"> Learn More</button>
</ion-nav-buttons>
<ion-content>
<ion-refresher
pulling-text="Pull to refresh..."
on-refresh="doRefresh()">
</ion-refresher>
<ion-list can-swipe="listCanSwipe">
<ion-item class="item-icon-left" ng-repeat="player in players" href="#/app/players/{{player.id}}">
<i class="icon ion-ios-contact"></i>
{{player.fname}} {{player.lname}}
<span class="item-note">
{{player.city}}, {{player.state}}
</span>
<ion-option-button class="button-positive" ng-click="share(item)">
[Option 1]
</ion-option-button>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
My question is specifically about the <span class="item-note">
part. 我的问题是关于<span class="item-note">
部分。 I got this example code from Ionic's examples here: http://ionicframework.com/docs/components/#item-icons . 我从这里的Ionic示例中获得了这个示例代码: http : //ionicframework.com/docs/components/#item-icons 。 In their example you can see the note text is all the way to the right edge but in my page there is a lot of padding. 在他们的示例中,您可以看到注释文本一直到右边缘,但在我的页面中有很多填充。 I viewed source and it appears to be coming from here... 我查看了源代码,它似乎来自这里......
.item-complex .item-content, .item-radio .item-content {
position: relative;
z-index: 2;
padding: 16px 49px 16px 16px;
border: none;
background-color: #fff;
}
I know I could write my own css to override this but I'd rather it just work like in their example without me tinkering with it. 我知道我可以编写自己的CSS来覆盖它,但我宁愿它只是在他们的例子中工作,而不是我修补它。 So did I do something wrong in the markup? 那么我在标记中做错了什么? Is this a bug? 这是一个错误吗? How do I get rid of this 49px gap on the right side so it looks like their example? 如何摆脱右侧49px的差距让它看起来像他们的榜样? Thanks! 谢谢!
In this case in your template template you are use </ion-option-button>
. 在这种情况下,您可以使用模板模板</ion-option-button>
。
So for that its adding extra padding from right side in ion-item. 因此,它在离子项中从右侧添加额外的填充。
If you remove that one you get the exact result , in example option button not there. 如果删除那个,则会得到确切的结果,而不是那里的示例选项按钮。
Due to this .item-radio
class are added. 由于这个.item-radio
类被添加。
If you will required that one so may be you need to your customized css. 如果您需要那个,那么您需要定制的CSS。
Hope this will help you ! 希望这个能对您有所帮助 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.