给RelativeLayout动态添加widget或TextView,,TextView tv
分享于 点击 48472 次 点评:227
给RelativeLayout动态添加widget或TextView,,TextView tv
TextView tv = new TextView(this);RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);tv.setLayoutParams( layoutParams );tv.setText(getString(R.string.loading));tv.setGravity(Gravity.CENTER_HORIZONTAL);layout.addView(tv);
用户点评