假设我有4个视图,连续3个视图,另一个视图中有1个视图。第一排的那些有动态高度,我们不知道它们有多高。
我想从这张图片中获得结果:
基本上我想在第一行中将View 4的顶部设置为最高视图的底部。我怎样才能做到这一点?
答案 0 :(得分:1)
使用view4.topAnchor.constraint(greaterThanOrEqualTo: view1.bottomAnchor, constant: 10).isActive = true
view4.topAnchor.constraint(greaterThanOrEqualTo: view2.bottomAnchor, constant: 10).isActive = true
view4.topAnchor.constraint(greaterThanOrEqualTo: view3.bottomAnchor, constant: 10).isActive = true
:
views.py
recent_results_ids = []
[recent_results_ids.append(i.id) for i in Results.objects.raw('SELECT MAX(id) id FROM results WHERE hide = 0 GROUP BY site ORDER BY MAX(created) DESC LIMIT 10')]
recent_results = Results.objects.filter(id__in=recent_results_ids).order_by('-id')
答案 1 :(得分:0)
将 var React = require('react');
var ReactDOM = require('react-dom');
var {HashRouter, Route,Link, hashHistory, Switch} = require('react-router-dom');
var Main = require('Main');
var Weather = require('Weather');
var About = require('About');
var Examples = require('Examples');
ReactDOM.render(
<HashRouter>
<div>
<Route exact path="/about" component={About} />
<Route exact path="/examples" component={Examples} />
<Route exact path= "/" component={Main} />
</div>
</HashRouter>
,document.getElementById('app')
);
,View1
和View2
放在View3
(或常规UIStackView
)中,然后在此UIView
之间添加约束{ {1}}和bottom
的{{1}}