【问题标题】:View table/collections inside container view not visible under translucent tab bar容器视图内的视图表/集合在半透明标签栏下不可见
【发布时间】:2016-05-01 07:19:54
【问题描述】:

我的根视图控制器上有一个容器视图,其自动布局约束为

我在容器视图中添加了一个视图控制器

AddChildViewController(toViewController);
ContainerView.AddSubview(toViewController.View);
toViewController.View.LayoutIfNeeded();

UIView.Animate(0.5, () =>
{
   toViewController.View.Frame = new CoreGraphics.CGRect(0, 0, ContainerView.Frame.Width, ContainerView.Frame.Height);
   toViewController.View.LayoutIfNeeded();

}, () =>
{
   toViewController.DidMoveToParentViewController(this);
});

顺便说一句,“标签”下方是一个 CollectionView。 我想发生的事情是这样的。

上图的根视图控制器是UITableViewController,完美的展示了它背后有一个内容。但是在容器视图上添加的 UICollection 视图的情况下。它只是这样显示。

任何信息将不胜感激。谢谢。

【问题讨论】:

    标签: xamarin xamarin.ios autolayout interface-builder


    【解决方案1】:

    约束Bottom Layout Guide.top = Container View.bottom 是导致此问题的原因。

    在您的 CardCollection 视图 xib 文件中,让您在父视图上拥有这些设置:

    通过 ctrl-click-drag up 到父 View 来设置底部约束以查看:

    如果您保持 alt,您将获得以下选项:

    然后确保你的容器视图像这样穿过标签栏:

    【讨论】:

    • 太棒了。我不知道Alt 选项部分。
    • 是的,它隐藏得很好,有一天我对自动布局感到恼火时发现了它。
    猜你喜欢
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多