这实在是一个肮脏的黑客,所以只用它作为你的最后一个资源。
如果这是你想要
您可以使用FrameLayout
同时包含ImageView
和TextView
这样做
final TextView tv = (TextView) findViewById(R.id.TextView01);
tv.setTransformationMethod(new TransformationMethod() {
private static final String INDENT = " ";
@Override
public void onFocusChanged(View view, CharSequence sourceText,
boolean focused, int direction, Rect previouslyFocusedRect) {
// TODO Auto-generated method stub
}
@Override
public CharSequence getTransformation(CharSequence source, View view) {
return INDENT + source;
}
});
什么。 请注意,如果图标跨越多行,则不起作用。
是的,但它轮胎在我的TextView垂直中心drawable。我想要它在左上角布局。 – hap497 2010-02-17 23:19:31