使用Java动态设置官方百分比布局PercentRelativeLayout的heightPerce

View view = findViewById(R.id.view_child);
PercentRelativeLayout.LayoutParams params = (PercentRelativeLayout.LayoutParams) view.getLayoutParams();
// This will currently return null, if it was not constructed from XML.
PercentLayoutHelper.PercentLayoutInfo info = params.getPercentLayoutInfo();
info.heightPercent = 0.60f;
view.requestLayout();

http://stackoverflow.com/questions/32292656/percentrelativelayout-how-to-set-the-height-programaticallyandroid

https://github.com/JulienGenoud/android-percent-support-lib-sample/issues/8git

相关文章
相关标签/搜索