`
李村民
  • 浏览: 38429 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

LayoutParams lp = (LayoutParams) mChangeSexLayout.getLayoutParams();

 
阅读更多
LayoutParams lp = (LayoutParams) mChangeSexLayout.getLayoutParams();
            if (!mIsChangeSexLayoutExpand) {
                lp.rightMargin = dip2px(5);
                mChangeSexLayout.setLayoutParams(lp);
            } else {
                lp.rightMargin = -dip2px(65);
                mChangeSexLayout.setLayoutParams(lp);
            }
            mChangeSexLayout.clearAnimation();
分享到:
评论

相关推荐

    谷歌开源的Android排版库 FlexboxLayout.zip

    FlexboxLayout.LayoutParams lp = (FlexboxLayout.LayoutParams) view.getLayoutParams(); lp.order = -1; lp.flexGrow = 2; view.setLayoutParams(lp);屏幕截图: 标签:谷歌 google 排版库

    Android自定义组件之自动换行View

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); int childWidth = child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; if (currentLineWidth + childWidth > widthSize) { // 换行 ...

    自定义ViewGroup实现流式布局demo

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); int childWidth = child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; int childHeight = child.getMeasuredHeight() + lp.topMargin + lp...

    TouchExtendView:Android 触摸扩展视图

    TouchExtendView 触碰范围扩大的View ##开发动机传统的按钮有效触碰范围可能就只有背景图片的可视范围内,但若是... LayoutParams LP = getLayoutParams(WH.getW(50),WH.getH(50)); LP.addRule(RelativeLayout.CENTER_

    android 实现自动换行的流布局

    MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); int childWidth = child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; int childHeight = child.getMeasuredHeight() + lp....

    ScrollView中自定义ListView

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); child.layout(lp.leftMargin, top + lp.topMargin, lp.leftMargin + child.getMeasuredWidth(), top + child.getMeasuredHeight() + lp.topMargin); ...

    Android悬浮窗按钮实现点击并显示/隐藏多功能列表

    lp.x = screenWidth - view.getLayoutParams().width * 2; lp.y = 0; lp.width = WindowManager.LayoutParams.WRAP_CONTENT; lp.height = WindowManager.LayoutParams.WRAP_CONTENT; } } ``` 在上面的代码中,...

    listview与scrollview冲突问题解决

    ViewGroup.LayoutParams params = listView.getLayoutParams(); params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1)); listView.setLayoutParams(params); } ``` 调用...

    ScrollView嵌套RecycleView解决高度不适配

    ViewGroup.LayoutParams lp = getLayoutParams(); lp.height = getMeasuredHeight(); } } ``` 4. **使用NestedScrollView替代ScrollView**:NestedScrollView是专门为处理嵌套滚动设计的,它能更好地处理内部...

    Android实现带进度条的WebView

    LayoutParams lp = (LayoutParams) progressbar.getLayoutParams(); lp.x = l; lp.y = t; progressbar.setLayoutParams(lp); super.onScrollChanged(l, t, oldl, oldt); } ``` 在布局文件中,我们将WebView...

    Android中ImageView.src设置图片拉伸、填满控件的方法

    ViewGroup.LayoutParams lp = testImage.getLayoutParams(); lp.width = screenWidth; lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; testImage.setLayoutParams(lp); testImage.setMaxWidth(screenWidth); ...

    自定义流式布局

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); int childWidth = child.getMeasuredWidth(); int childHeight = child.getMeasuredHeight(); if (lineLeft + childWidth > r - paddingLeft - ...

    android可换行的单选效果

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); totalWidth += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin; totalHeight = Math.max(totalHeight, child.getMeasuredHeight() + lp...

    自定义View中测量流程

    自定义View View的测量是从子View开始的,具体代码顺序是:父容器的onMeasure方法会遍历到每一个子childView –>然后调用... final LayoutParams lp = child.getLayoutParams(); final int childWidthMeasureSpec =

    Android 自定义可拖拽View界面渲染刷新后不会自动回到起始位置

    RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) getLayoutParams(); lp.setMargins(left, top, 0, 0); setLayoutParams(lp); ``` 这样,即使界面被刷新,View的位置也会保持在拖动结束时的状态。...

    Android解决软键盘遮挡输入框的示例代码

    ViewGroup.LayoutParams lp = getLayoutParams(); lp.height = getMeasuredHeight(); } // ... } ``` 2. 在布局XML文件中,用我们自定义的OverideLinearLayout替换原本的LinearLayout。这样,当键盘弹出时,...

    android自定义圆形布局CircleLayout

    LayoutParams lp = (LayoutParams) child.getLayoutParams(); // 计算子视图的角度 double angle = Math.toRadians(360.0 / count * i); // 计算子视图的x、y坐标 int childX = (int) (center + radius * ...

    Android Webview添加网页加载进度条实例详解

    LayoutParams lp = (LayoutParams) progressBar.getLayoutParams(); lp.x = l; lp.y = t; progressBar.setLayoutParams(lp); } ``` 通过以上步骤,我们就成功地在Android的Webview中实现了网页加载进度条的功能...

    Android WebView实现顶部进度条

    LayoutParams lp = (LayoutParams) mProgressBar.getLayoutParams(); lp.x = l; lp.y = t; mProgressBar.setLayoutParams(lp); super.onScrollChanged(l, t, oldl, oldt); } ``` 通过以上步骤,我们就成功地在...

Global site tag (gtag.js) - Google Analytics