LinearLayout ll = (LinearLayout)findViewById(R.id.linearLayout3);
TextView tv = new TextView(this);
ImageButton imb=new ImageButton(this);
ll.addView(tv);
tv.setSingleLine();
tv.setEllipsize(TruncateAt.MARQUEE);
tv.setHorizontallyScrolling(true);
tv.setFocusableInTouchMode(true);
tv.setText(myString1);
这是我的代码,我现在可以显示数据了textView
。但我想imageButton
在左边放一个,textView
这样就可以作为取消条。但我有一个问题。如何imageButton
以编程方式设置文本视图的左侧?