我想基于其单元格高度的总和从另一个viewcontroller更改tableview的高度,因为它们是动态的.它可能吗?谢谢
添加在:
我基本上拥有一个UserProfileViewController,它在屏幕的一半上有一个容器视图.在那里我添加了不同的其他viewcontrollers:


在wall按钮的情况下,这是我添加viewcontroller的方式,它是后续的tableview:
- (IBAction)wallButtonPressed:(id)sender
{
//Check if there is an instance of the viewcontroller we want to display. If not make one and set it's tableview frame to the container's view bounds
if(!_userWallViewController) {
self.userWallViewController = [[WallViewController alloc] init];
// self.userWallViewController.activityFeedTableView.frame = self.containerView.bounds;
}
[self.userWallViewController.containerView addSubview:self.userWallViewController.activityFeedTableView];
//If the currentviewcontroller adn it's view are already added to the hierarchy remove them
[self.currentViewController.view removeFromSuperview];
[self.currentViewController removeFromParentViewController];
//Add the desired viewcontroller to the currentviewcontroller
self.currentViewController = self.userWallViewController;
//Pass the data needed …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建自己的滚动条.我已经尝试了大多数jquery滚动条插件,但它们似乎都不适合我,所以我决定创建自己的.我有一个带可滚动内容的溢出区域.如果我能够找出可滚动内容区域的高度,我可以让滚动条工作.我尝试过.scrollHeight(),浏览器甚至无法识别它.溢出区域具有固定位置.
我UITabBarController用作root视图,app支持iOS 6及更高版本.项目类层次结构如下.
UITabBarController
- tab1
- UINavigationController
- UIViewController
- UIViewController
.
.
- tab2
- UINavigationController
- UIViewController
- UIViewController
.
.
.
- tab3
- UIViewController
- tab4
- UIViewController
Run Code Online (Sandbox Code Playgroud)
我使用下面的代码来改变上面层次结构UITabBar中的一个UIViewControllers(在里面UINavigationController)的高度.
CGRect tabbarFrame = self.tabBarController.tabBar.frame;
tabbarFrame.size.height += 60;
self.tabBarController.tabBar.frame = tabbarFrame;
Run Code Online (Sandbox Code Playgroud)
但它没有改变高度.UITabBar以默认高度显示.虽然记录其值打印更改值,如下所示.
<UITabBar: 0xb528f60; frame = (0 431; 320 109); autoresize = W+TM; layer = <CALayer: 0xb529080>>
Run Code Online (Sandbox Code Playgroud)
我怎样才能改变UITabBar高度来达到这样的目的:?

所以我在尝试设置视图的背景可绘制时有点混乱.该代码依赖于知道视线的高度,所以我不能把它onCreate()或onResume(),因为getHeight()返回0 onResume()似乎是最接近我可以得到虽然.我应该在哪里放置如下所示的代码,以便在显示给用户时背景发生变化?
TextView tv = (TextView)findViewById(R.id.image_test);
LayerDrawable ld = (LayerDrawable)tv.getBackground();
int height = tv.getHeight(); //when to call this so as not to get 0?
int topInset = height / 2;
ld.setLayerInset(1, 0, topInset, 0, 0);
tv.setBackgroundDrawable(ld);
Run Code Online (Sandbox Code Playgroud) 我在启动时修改UIView高度时遇到问题.
我必须UIView,我想要一个屏幕尺寸*70和另一个填补空白.
这就是我所拥有的
@IBOutlet weak var questionFrame: UIView!
@IBOutlet weak var answerFrame: UIView!
let screenSize:CGRect = UIScreen.mainScreen().bounds
Run Code Online (Sandbox Code Playgroud)
和
questionFrame.frame.size.height = screenSize.height * 0.70
answerFrame.frame.size.height = screenSize.height * 0.30
Run Code Online (Sandbox Code Playgroud)
它在运行时对应用程序没有影响.我使用自动布局,但我只有边距约束...
我做错了吗?
我自己正在寻找一个简单的解决方案,用它中的内容来改变iframe的高度.
似乎规则是你不能从持有它的页面获得iframe的高度.这是因为安全性显而易见.我们应该怎么做?
我有一个网站,其布局已在图表中显示.所述主体包括一个main container,该方法包括header,parent div和footer.所述parent div进一步包含若干child div如图所示.

问题是所有的高度child div是有限的.但parent div除了儿童div之外什么都没有.所有子div都可见,但父div的高度显示为零.我也没有通过给出一些预先指定的值来修正父div的高度,因为如果将来孩子的数量增加可能会导致错误.
由于父div的大小为零而导致的问题是我的页脚div正在上升并与父div的内容冲突.这可以通过给出合适的margin-top来解决,但这不是我正在寻找的解决方案.
任何人都可以建议我某种方式,以便父div的高度根据存在的子div的高度自动改变.
如果我不清楚我的疑问,请发表评论!
是否有可能使包装器填充窗口高度(没有滚动)和中心div可滚动而不会弄乱像素和JavaScript?
<div id="wrapper">
<h1>Header</h1>
<div id="center">
<div style="height:1000px">high content</div>
</div>
<div id="footer">Footer</div>
</div>
Run Code Online (Sandbox Code Playgroud)
基本上我希望标题在顶部可见,页脚始终在底部可见,并且在中心有一个可滚动的内容,占据了重新生成的高度.
页眉,页脚和中心div的高度都是未知的(没有设置px或%,即可变字体大小或填充).纯CSS可以吗?
height ×10
css ×2
dynamic ×2
ios ×2
jquery ×2
android ×1
css3 ×1
html ×1
iframe ×1
ios7 ×1
layout ×1
objective-c ×1
parent-child ×1
resize ×1
scroll ×1
scrollable ×1
swift ×1
uitabbar ×1
uitableview ×1
uitextview ×1
uiview ×1
webpage ×1
xcode6 ×1