2012-12-17 24 views
2

我想编辑一个注释并在其背景中画一条纸线。像下面的图片(你可以看到,无论是纵向和横向线):如何在Android中使用纸行编辑注释?

enter image description here

我不知道我该怎么画它,我怎么能重复一次吗?

+1

如果你只是画线为什么你不能使用画布? – cjds

+0

如何使用画布?你能告诉我一个多行图片的样本吗? –

+0

看来这是ImageView中目前缺少的功能。我怀疑你需要创建自己的View类来处理你自己的重复绘图。 – jsmith

回答

4

这里是你的问题https://stackoverflow.com/a/10770670/619673

当然你也可以在TextView中实现它(与话题是关于EditText上),但它是完全一样的操作答案(我想:d)。 要使用它,在你的XML,你必须写,而不是TextView你的包路径的自定义Widget类即com.example.notepad.linkededit

enter image description here

例子:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MainActivity" > 

    <com.example.notepadline.LinedEditText 
     android:id="@+id/tv" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:singleLine="false" 
     android:text="AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA AAAA AAAA AAA" /> 

</RelativeLayout> 

的其他信息是在引用链接。

相关问题