2013-11-26 103 views
0

我在布局中定制了EditText。文中的内容按照您在图片中可以看到的方式正确排列。即使EditText未定制,也是同样的问题。有一段时间这封信出现在另一个上面。Edittext中的文本显示不正确

前3个字母排列整齐即: 1.Harry波特 2.N 3.M:'( ,其余均为不整洁arranged.Please帮助我在这种情况下

text in Edittext do not appears proper-IMAGE

<com.android.project.birthdayreminder.LineEditText 
        android:id="@+id/edtextview_note" 
        android:layout_width="match_parent" 
        android:layout_height="0dip" 
        android:layout_weight="1"  
        android:hint="Notes:\nThings planned for the Birthday /Aniversary"  
        android:singleLine="false" 
        android:textColor="#000000"     
        android:scrollbarAlwaysDrawVerticalTrack="true" 
        android:scrollbars="vertical" 
        android:gravity="top"          
        android:background="@drawable/activity_background" 
        android:layout_marginBottom="3dip" 
        android:paddingLeft="10dip" 
        android:paddingRight="10dip"/> 
+1

我的猜测是它是关闭线条的绘图代码。如果在视图中使用相同的字符,您应该尝试使用未修改的视图,截图并测量像素。这样做是为了缩小错误。然后,逐步编码并检查是否有效... – tilpner

回答

0

你试图做的实际上是危险的,因为你正在尝试一些文本行放入一个背景。

你不知道ADVAN ce什么设备将运行您的应用程序,因此尽管设备看起来没问题,但其他设备可能会以不同的方式缩放背景或使用不同的字体大小。

我可以尝试帮助您在文字之间设置文字,但我认为这不是一个合适的解决方案。相反,我会从背景中删除线条,或者一旦知道线条高度,尝试将线条绘制为占位符,但不会更快。

希望这会有所帮助。