android 动态改变LinearLayout 宽高参数

做项目,觉得这些零碎知识点很难记,小计一下
public static void toBigStyle(Activity activity) {
//		View topbannerRL = null;
//		View fourTabMenuLL = null;
//		try {
//			int[] dm = Utils.getDisplayMetrics(activity);
//			//topbanner
//			if (dm[0] > Properties.DISPLAYMETTIC_MAX_VALUE) {
//				try {
//					topbannerRL = (RelativeLayout) activity.findViewById(R.id.topbanner);
//				} catch (Exception e) {
//					topbannerRL = (LinearLayout) activity.findViewById(R.id.topbanner);
//				}
//				if (topbannerRL != null) {
//					LayoutParams linearParams1 =  topbannerRL.getLayoutParams();
//					linearParams1.height = (int)(linearParams1.height * 2 );
//					topbannerRL.setLayoutParams(linearParams1);
//				} 
//				
//				try {
//					fourTabMenuLL = (LinearLayout) activity.findViewById(R.id.fourTabMenu);
//				} catch (Exception e) {
//					fourTabMenuLL = (RelativeLayout) activity.findViewById(R.id.fourTabMenu);
//				}
//				
//				if (fourTabMenuLL != null ) {
//					LayoutParams linearParams2 =  fourTabMenuLL.getLayoutParams();
//					linearParams2.height = (int)(linearParams2.height * 2 );
//					fourTabMenuLL.setLayoutParams(linearParams2);
//				}
//			}
//		} catch (Exception e) {
//		}
//
//	}

你可能感兴趣的:(android 动态改变LinearLayout 宽高参数)