Java textview中的文本数量有限
首先看图片 我想把“谷歌”图像附近的文本填充到谷歌图像下的空白区域,看看谷歌图像下的区域(上图)是空的,文本没有填充到那里 我该怎么做 XML文件:::Java textview中的文本数量有限,java,android,textview,line,Java,Android,Textview,Line,首先看图片 我想把“谷歌”图像附近的文本填充到谷歌图像下的空白区域,看看谷歌图像下的区域(上图)是空的,文本没有填充到那里 我该怎么做 XML文件::: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/tools" a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/allbg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView8"
android:layout_gravity="center_horizontal"
android:background="@drawable/newstop" />
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Name Label -->
<!-- Input Name -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/slidebg"
android:id="@+id/slidebg"
android:layout_margin="7dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="70dp"
android:id="@+id/imgad2"
android:visibility="visible"
android:layout_marginTop="9dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="6dp"
/>
</RelativeLayout>
<TableLayout android:id="@+id/TableLayout01" android:stretchColumns="*"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:layout_centerInParent="true" android:layout_below="@+id/slidebg"
android:layout_margin="5dp">
<TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent"
android:layout_height="0px" android:layout_weight="1" >
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnshare"
android:background="@drawable/opbg"
android:text="Share"
android:paddingLeft="20dp"
android:paddingTop="4dp"
android:textSize="19dp"
android:textColor="#cccccc"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btncopy"
android:background="@drawable/opbg"
android:text="Copy"
android:paddingLeft="20dp"
android:paddingTop="3dp"
android:textSize="19dp"
android:textColor="#cccccc"/>
</LinearLayout>
</TableRow></TableLayout>
<!-- Price Label -->
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- Button Create Product -->
<Button android:id="@+id/btnSave"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Save Changes"
android:layout_weight="1"
android:visibility="gone" />
<!-- Button Create Product -->
<Button android:id="@+id/btnDelete"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Delete"
android:layout_weight="1"
android:visibility="gone" />
</LinearLayout>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Price"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:paddingTop="10dip"
android:textSize="17dip"
android:visibility="gone" />
<!-- Input Price -->
<EditText android:id="@+id/inputPrice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_marginBottom="15dip"
android:singleLine="true"
android:inputType="numberDecimal"
android:visibility="gone" />
<!-- Description Label -->
<!-- Input description -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="@drawable/listrowbg"
android:id="@+id/card_view4"
card_view:cardCornerRadius="4dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/TableLayout01">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/titcon">
<TextView
android:id="@+id/tvname"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="6dip"
android:paddingLeft="6dip"
android:textSize="16dp"
android:textColor="#fafafa"
android:textDirection="ltr"
android:textStyle="bold"
android:maxWidth="200dp"
android:width="200dp"
android:phoneNumber="false"
android:text="Abadi - SohMj"
android:layout_marginTop="-4dp" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/newshead"
android:id="@+id/titsp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titcon">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="این متن خبر تست است!"
android:id="@+id/tvdes"
android:maxLines="90"
android:ellipsize="end"
android:textSize="18dp"
android:singleLine="false"
android:textDirection="rtl"
android:textColor="#fcf8f8f8"
android:layout_weight="0.95"
android:maxLength="20000"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_toRightOf="@+id/linearLayout2"
android:layout_toEndOf="@+id/linearLayout2"
android:weightSum="1"/>
<LinearLayout
android:layout_width="130dp"
android:layout_height="130dp"
android:gravity="left|top"
android:id="@+id/linearLayout2"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:clickable="false">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/image"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="تمامی اخبار و نوشته ها حق رپفارسی می باشد و هرگونه کپی پیگرد دارد."
android:id="@+id/textView2"
android:layout_gravity="center_horizontal"
android:layout_below="@+id/card_view4"
android:textColor="#fff"
android:textSize="14dp"
android:gravity="center"
android:textStyle="bold"
android:layout_marginTop="5dp" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
以xml格式给出属性中的数字
android:maxLength="100"
您可以通过设置TextView的最大限制来实现这一点
...
android:layout_height="wrap_content" //your ImageView Height
android:maxLines="1" //Number of Lines you need to limit
android:maxLength="10" //character limit
android:ellipsize="end"
..
..请试试这个
android:maxLength="12"
使用此库可将文本环绕图像
显示xml文件请你们的代码只是为文本视图设置了一个最大长度,我尝试了代码,但行中仍有空白处,如图片…你们的代码只是为文本视图设置了一个最大长度,我尝试了代码,但行中仍有空白处,如图片…我不明白你们对我意味着什么。请详细告诉我谷歌图片下没有文字!我想把我的文字填到谷歌图片下面的空白处你需要这样,我得到这个错误“你无权查看这个页面”,我想这不是关于androidyou的代码只是为文字查看设置了一个最大长度,我尝试了代码,但行中仍然有空的地方,如图片…你想填充谷歌图片下的空间吗?那你为什么要问限制人数?需要在布局层次结构中进行更改。google图像的资源id是什么?代码中不清楚。linearLayout2内的图像视图;请帮助我查看linearLayout2内的图像;请帮助我@Anitha Manikandanhi,我在导入此项目时面临问题;能告诉我吗?它很好用,我用过它。。。我正在使用intellij 14.1.4。。。。告诉我错误,你面临什么样的问题。。。以及您正在使用的构建类型(eclipse、intellij、android studio)。。