जब मैं singleLine="true"
और ellipsize="end"
(मेरी शीर्ष TextView), यह अच्छी तरह से काम करता हैTextView पर लपटने की स्थापना एक (के बजाय केवल पिछले लपेटने) द्वारा दिखाया गया लाइनों
साथ TextView
उपयोग कर रहा हूँ लेकिन एक औरTextView
में कम कर देता है 1 लाइनों के बाद (मेरे मामले में 0 नीचे TextView
में 3 लाइनें), lines="3" and maxLines="3" and ellipsize="end",
ठीक से काम नहीं करता है।
जब मैं tvDesc में ellipsize="end"
नहीं डालता, तो यह 3 लाइन दिखाता है, जो ठीक है। एक्सएमएल:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imgv"
android:layout_width="65dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/img1"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imgv"
android:background="@android:color/white"
android:textColor="@android:color/black"
android:text="Title testing line number and ellipsize at end"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end" <--- WORKS WELL
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvTitle"
android:layout_toRightOf="@+id/imgv"
android:layout_alignBottom="@+id/imgv"
android:layout_alignParentRight="true"
android:textSize="14dp"
android:lines="3"
android:maxLines="3"
<---------- WITHOUT ellipsize
android:text="I wanna this textview of having 3 lines and ellipsize at END and at this time I am Testing for it. This TextView shows 3 lines WITHOUT ellipsize property, but shows only 2 Lines when ELLIPSIZE property is setted"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
कोड से ऊपर 3 लाइन्स के साथ TextView tvDesc और नो-लपटने से पता चलता यहाँ कोड है। यहाँ छवि है:
लेकिन, मुझे एल्लिप्साइज करना चाहते हैं, तो मैं followin कोड का उपयोग करता है: एक्सएमएल:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imgv"
android:layout_width="65dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/img1"
android:scaleType="fitXY" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/imgv"
android:background="@android:color/white"
android:textColor="@android:color/black"
android:text="Title testing line number and ellipsize at end"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvTitle"
android:layout_toRightOf="@+id/imgv"
android:layout_alignBottom="@+id/imgv"
android:layout_alignParentRight="true"
android:textSize="14dp"
android:lines="3"
android:maxLines="3"
android:ellipsize="end" <------ WITH ELLIPSIZE
android:text="I wanna this textview of having 3 lines and ellipsize at END and at this time I am Testing for it. This TextView shows 3 lines WITHOUT ellipsize property, but shows only 2 Lines when ELLIPSIZE property is setted"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
कौन सा केवल 2 लाइनों और लपटने साथ TextView tvDesc पता चलता है,
जो उचित रूप से डीजर्ड यूआई नहीं है, फॉलोइन:
मैं साथ एल्लिप्साइज
किसी को भी मेरी मदद कर सकते TextView tvDesc में 3 लाइनों चाहता हूँ।?
मुझे लगता है कि अगर आप किसी [ज्ञात समस्या] में चल रहा है (http: // stackoverflow। कॉम/प्रश्न/2160619/एंड्रॉइड-इलिप्सिज़-मल्टीलाइन-टेक्स्टव्यू) – tiguchi
मुझे नहीं पता कि यह वास्तव में क्यों खुश है। लेकिन अगर आप इलिप्सिज़ के साथ जाना चाहते हैं तो आप अंत की बजाय अपनी कोई संपत्ति नहीं रखेंगे। –