2
我想在活动的运行时显示图像和文本。 同样就像在WHATSAPP中发生的聊天一样。 我在textview中显示文本,在imageview中显示图像。 我面临的问题是,我想与滚动 在同一活动展示他们两人对于如:在运行时显示图像和文本,android?
image
text
text
image
text
image
image
我应该使用哪种布局或控件来显示这样的吗?
我想在活动的运行时显示图像和文本。 同样就像在WHATSAPP中发生的聊天一样。 我在textview中显示文本,在imageview中显示图像。 我面临的问题是,我想与滚动 在同一活动展示他们两人对于如:在运行时显示图像和文本,android?
image
text
text
image
text
image
image
我应该使用哪种布局或控件来显示这样的吗?
同时添加这样的..
LinearLayout linearLayout=new LinearLayout(this);
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams vp=new
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
TextView tv = new TextView(this);
tv.settext("test");
linearLayout.addView(imageView,tv);
ImageView imageView= new ImageView(this);
imageView.setImageBitmap(bitMap);
imageView.setVisibility(View.VISIBLE);
imageView.setBackgroundColor(0xFFFF00FF);
//linearLayout=LinearLayout+imageView;
LinearLayout.LayoutParams Iv=new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
linearLayout.addView(imageView,Iv);
setContentView(linearLayout,vp);
使用Android教程应该做的伎俩开始。 http://developer.android.com/training/index.html – OcuS