jjzjj

layoutMargin

全部标签

ios - 使用自动布局或 layoutMargins 向 UILabel 添加填充?

这个问题在这里已经有了答案:ResizingaUILabeltoaccommodateinsets(8个答案)关闭8年前。我想在标签的框架和文本之间添加插图。我认为使用layoutMargins(http://carpeaqua.com/2014/07/24/auto-layout-in-ios-8-layout-margins/)是可能的,但我无法做到这一点。我有一个示例项目,您可以在其中看到我在做什么(错了吗?):https://github.com/runmad/MessagingApp

ios - 设置 UIView 的 layoutMargins 不起作用

UIViewController与UIView和UITableViewUIView|-UITableView我正在尝试像这样设置边距:-(void)viewDidLoad{[superviewDidLoad];self.view.layoutMargins=UIEdgeInsetsMake(30,30,30,30);self.tableView.preservesSuperviewLayoutMargins=YES;[self.viewlayoutIfNeeded];}但是View上什么也没有发生。这是来自InterfaceBuilder的约束(lldb)poself.view.con

ios - 设置 UIView 的 layoutMargins 不起作用

UIViewController与UIView和UITableViewUIView|-UITableView我正在尝试像这样设置边距:-(void)viewDidLoad{[superviewDidLoad];self.view.layoutMargins=UIEdgeInsetsMake(30,30,30,30);self.tableView.preservesSuperviewLayoutMargins=YES;[self.viewlayoutIfNeeded];}但是View上什么也没有发生。这是来自InterfaceBuilder的约束(lldb)poself.view.con

ios - UIView.layoutMargins 和 AlignmentRect 的区别

我正在(再次)弄清楚如何为自定义UIView实例设置边距。据我所知,我必须通过alignmentRectInsets方法设置AlignmentRect。但这不适用于自动布局。在谷歌上搜索我发现还有另一个属性叫做layoutMargins。所以问题是layoutMargins和alignmentRect做了什么?它们相互影响吗?完全不同的东西? 最佳答案 layoutMargins确定View内部的内容如何使用自动布局定位。通常这用于使对象与View边缘保持特定距离。alignmentRectInsets用于告诉自定义View之外的对

Android fragment 对话框在使用 weightSum 时似乎忽略了 layoutMargin 或 layoutWidth

所以我在按下按钮时创建了DialogFragment,用于选择一些信息。如果我使用weightSum,似乎无论我做什么,即使我指定了layoutMargin或父布局的宽度,diaglog也会填满屏幕。这是在运行3.2的GalaxyTab上使用默认的Fragment库而不是兼容性库。任何建议都会有所帮助。谢谢下面是我正在使用的布局。 最佳答案 我很奇怪为什么android:weightSum在我们使用LinerLayout中的Relative布局时表现出意外。我已经尝试过你的代码并且能够管理所有的LinerLayout..试试这个..