Tag: height

以编程方式将imageview的高度设置为matchparent

我需要将imageview的高度设置为matchparent编程方式。如果它是一个固定的高度,我知道如何设置。 但我怎么能把它设置为matchparent? 编辑: 实际上父布局的高度dynamic.so我需要使imageview的高度作为父母的高度。

如何更改UIView大小?

我在启动时修改我的UIView高度有问题。 我必须UIView,我想要一个屏幕大小* 70和其他填补空白。 这是我的 @IBOutlet weak var questionFrame: UIView! @IBOutlet weak var answerFrame: UIView! let screenSize:CGRect = UIScreen.mainScreen().bounds 和 questionFrame.frame.size.height = screenSize.height * 0.70 answerFrame.frame.size.height = screenSize.height * 0.30 它在运行时对应用程序没有影响。 我使用自动布局,但我只有边缘限制… 我做错了吗?

使用自动resize创build一个textarea

还有另一个关于这个的线索 ,我试过了。 但是有一个问题:如果删除内容,textarea不会缩小。 我找不到任何方法缩小到正确的大小 – clientHeight值作为textarea的完整大小,而不是其内容。 该页面的代码如下。 我会很感激任何帮助或指针。 function FitToContent(id, maxHeight) { var text = id && id.style ? id : document.getElementById(id); if ( !text ) return; var adjustedHeight = text.clientHeight; if ( !maxHeight || maxHeight > adjustedHeight ) { adjustedHeight = Math.max(text.scrollHeight, adjustedHeight); if ( maxHeight ) adjustedHeight = Math.min(maxHeight, adjustedHeight); if ( adjustedHeight […]