中的设备线性布局我有4个图像在linearlayout内以编程方式创建,我想在第四个图像上设置textview如何设置??如果你有一块代码请分享跟我??如何设置4个图像为线性布局根据android
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 300, 1.0f);
public void path(ArrayList<Integer> integerImg) {
// int width=mContext.getWgetWindowManager().getDefaultDispaly.getWidth();
ImageView images;
for (int i = 0; i < integerImg.size(); i++) {
if (i < 4) {
images = new ImageView(mContext);
params.setMargins(10, 0, 0, 0);
images.setLayoutParams(params);
images.setScaleType(ImageView.ScaleType.FIT_XY);
images.setBackgroundResource(R.drawable.salon_profile_back);
images.setImageResource(integerImg.get(i));
linearImgGrid.addView(images);
}
能否请您与我们分享您的代码,并告诉我们,不能正常工作的一部分。 – peshkira
看到上面的代码,我想在第4张图片上显示textview? – Shreyas