如何使离子列表中的项目变小(不太高)? [英] How do I make items in an Ionic list smaller (less tall)?
问题描述
标准离子列表
ion-items
中的项目对我的应用来说太大了。如何使它们垂直缩小/缩短?
The items in a standard ion-list
of ion-items
are too big for my app. How do I make them vertically smaller/shorter?
似乎试图修改 .item
类产生的结果完全是胡说八道。这不是答案。修改相同的填充属性似乎没有做任何事情。也不是答案。
It seems that trying to modify the margin properties of the .item
class yields results that are, well, complete nonsense. This is not the answer. Modifying the padding properties of the same seems not to do anything. Also not the answer.
推荐答案
你需要修改 .item-content的属性
class。
You need to modify the properties of the .item-content
class.
以下代码将列表项的填充从可笑的大16px默认值减少到更易于管理的12px。
The following code will reduce the padding on list items from the comically large 16px default to a more manageable 12px.
.item-content {
padding-top: 12px;
padding-bottom: 12px;
margin-top: -4px;
margin-bottom: -4px;
height: 70px;
}
这篇关于如何使离子列表中的项目变小(不太高)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!