0

我有一个图像视图和一个文本视图。文本视图位于图像视图下方。我需要图像视图右侧的文本视图。怎么做?

               LinearLayout ThelayoutL = new LinearLayout(getApplicationContext());
        ThelayoutL.setOrientation(LinearLayout.VERTICAL);   

             ImageView TheItemImageL = new ImageView(mContextL);
        TheItemImageL.setImageBitmap(ItemImageBytesListG.get(PositionP));
        TheItemImageL.setScaleType(ImageView.ScaleType.FIT_XY);
        TheItemImageL.setLayoutParams(new ListView.LayoutParams(100, 100));

        TextView tvItemNameL = new TextView(mContextL);
        tvItemNameL.setText(zItemNameListG.get(PositionP));
        tvItemNameL.setGravity(Gravity.CENTER);
        tvItemNameL.setTextSize(10);
        tvItemNameL.setTextColor(Color.parseColor("#000000"));
4

2 回答 2

1

尝试ThelayoutL.setOrientation(LinearLayout.HORIZONTAL);

于 2013-02-19T05:45:35.173 回答
1

代替

ThelayoutL.setOrientation(LinearLayout.VERTICAL); 

ThelayoutL.setOrientation(LinearLayout.HORIZONTAL);

希望能帮助到你。

于 2013-02-19T05:46:57.753 回答