我正在LeadingSpanMargin2按照建议使用我的样式TextView以便它会绕过Image,问题是我设置的文本是动态的,可以是rtl或ltr.
我尝试了任何我能想到的东西来修复leadingMargin它,以便它在两种情况下都是正确的或者是左的,都无济于事.
此外,我已经尝试FlowTextView在github上发布的小部件,它在rtl情况下效果不佳,所以请不要提示.
非常感谢.
这是我使用的代码,在另一个答案中提出:
public void setFlowText(CharSequence text, int width , int height, TextView messageView)
{
float textLineHeight = messageView.getPaint().getTextSize();
// Set the span according to the number of lines and width of the image
int lines = (int)Math.ceil(height / textLineHeight);
//For an html text you can use this line: SpannableStringBuilder ss = (SpannableStringBuilder)Html.fromHtml(text);
SpannableString ss = new SpannableString(text);
ss.setSpan(new MyLeadingMarginSpan2(lines, width), 0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//ss.setSpan(new AlignmentSpan.Standard(Alignment.ALIGN_OPPOSITE), 0, ss.length(), …Run Code Online (Sandbox Code Playgroud) 我有两个JTables,一个在主视口,一个在页脚视口,使用JideScrollPane. 问题是当 mainJTable的视图被自定义时,页脚JTable保持不变,有什么方法可以同步它们的视图吗?
谢谢。
