由主页界面引出的几个知识点(四)
来源:互联网 发布:网络销售的工作怎么样 编辑:程序博客网 时间:2024/06/05 07:33
java List复制:浅拷贝与深拷贝
http://blog.csdn.net/demonliuhui/article/details/54572908
List集合的复制方式小结
说明:通过new ArrayList<T>(List<T> srcList)的方式复制一个集合,是单独开辟了一个内存空间,并且内容跟源集合的内容一样。对新集合的修改并不影响源集合。
布局a再b下,能用代码动态修改为a在b上吗
设置控件布局时:
方法一:addRule(int verb)
方法二:addRule(int verb, int anchor)
此处第二个参数是控件ID,有关控件ID可以点击查看:android在代码中为new出的控件设置ID及setId()异常
https://www.cnblogs.com/Annoying/p/5402339.html
<RelativeLayout
android:id="@+id/ll_tab_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.CardView
android:id="@+id/card_column"
style="@style/home_card_style"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.dx168.efsmobile.me.widget.HomeCardTitleLayout
android:id="@+id/column_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentIcon="@drawable/hundreds_icon"
app:contentText="百家专栏"
app:rightIcon="@drawable/home_right_more_arrow"
app:rightText="查看更多"/>
<FrameLayout
android:id="@+id/cloumn_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/column_more"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@id/card_image"
style="@style/home_card_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/card_column"
android:layout_marginBottom="7dp"
android:layout_marginTop="5dp">
<ImageView
android:id="@+id/personal"
android:layout_width="match_parent"
android:layout_height="72dp"
android:scaleType="fitXY"/>
</android.support.v7.widget.CardView>
<FrameLayout
android:id="@+id/fl_live_container_bottom"
android:layout_below="@id/card_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
if(isActiveUser){
RelativeLayout.LayoutParams imgParams = (RelativeLayout.LayoutParams)mImgCardView.getLayoutParams();
imgParams.addRule(RelativeLayout.BELOW,0);
imgParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
mImgCardView.setLayoutParams(imgParams);
RelativeLayout.LayoutParams columnParams = (RelativeLayout.LayoutParams)mlColumnCardView.getLayoutParams();
columnParams.addRule(RelativeLayout.ALIGN_PARENT_TOP,0);
columnParams.addRule(RelativeLayout.BELOW,mImgCardView.getId());//or params
mlColumnCardView.setLayoutParams(columnParams);
}else{
RelativeLayout.LayoutParamscolumnParams= (RelativeLayout.LayoutParams)mlColumnCardView.getLayoutParams();
columnParams.addRule(RelativeLayout.BELOW,0);
columnParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
mlColumnCardView.setLayoutParams(columnParams);
RelativeLayout.LayoutParams imgParams = (RelativeLayout.LayoutParams)mImgCardView.getLayoutParams();
imgParams.addRule(RelativeLayout.ALIGN_PARENT_TOP,0);
imgParams.addRule(RelativeLayout.BELOW,mlColumnCardView.getId());
mImgCardView.setLayoutParams(imgParams);
}
阅读全文
0 0
- 由主页界面引出的几个知识点(四)
- 由主页界面引出的几个知识点(一)
- 由主页界面引出的几个知识点(二)
- 由主页界面引出的几个知识点(三)
- 由主页界面引出的几个知识点(五)
- 由wchar_t 引出的
- 由继承引出的
- 由一段聊天记录引出的
- 由strlen引出的一些
- SpringMVC源码总结(四)由StringHttpMessageConverter引出的客户端服务器端之间的乱码过程分析
- SpringMVC源码总结(四)由StringHttpMessageConverter引出的客户端服务器端之间的乱码过程分析
- SpringMVC源码总结(四)由StringHttpMessageConverter引出的客户端服务器端之间的乱码过程分析
- 由数据绑定和排序引入的几个JavaScript知识点
- 由-128的补码引出的思考
- 由游戏引出的镜子理论
- 由vc2005 编译错误引出来的
- 由独生子女证引出的一系列问题
- 由显示/隐藏引出的CSSBug
- Kafka的部署
- SparkSQL下UDF的使用
- ARM NEON编译错误
- Laplace Beltrami Operator
- 动态增序插入排序
- 由主页界面引出的几个知识点(四)
- java重新再来之JDk及基础入门
- css心得
- shell学习手册(2)
- Hadoop概念&命令操作&java操作
- 面向对象多态性
- 机器学习资料链接
- hibernate的加载策略
- 操作系统1课程总结(进程的描述与控制,处理机调度与死锁)