TextView在android 2.3中只显示第一个字符而不是完整字符串

时间:2014-05-27 07:55:00

标签: android android-layout textview

我有TextView我正在设置一些文字“欢迎用户”,但在Android 4+手机中,它在快照中显示正常。

第一个屏幕,如果在Android 4.0.4 HTC mobile中,它显示“ITIL Foundation(在线课程)”。

Android 4+ screen

而在Android 2.3中,它只显示第一个角色。

其他屏幕Android 2.3.6仅显示“IT”

Android 2.3 screen

我搜索了,但没有任何好处。请建议。

我曾为所有版本的手机工作过,我从未遇到过这样的问题。请建议。

这是我的Xml代码:

    <?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"
    android:background="@color/color_background"
    android:orientation="vertical" >

    <include
        android:id="@+id/headerlayout"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentTop="true"
        layout="@layout/header_logout"
        android:visibility="gone" />

    <RelativeLayout
        android:id="@+id/footerlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_weight="1"
        android:padding="10dp" >

        <ImageView
            android:id="@+id/logo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:background="@drawable/header_logo"
            android:paddingLeft="3dp" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/title_course"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/headerlayout"
        android:gravity="center"
        android:padding="@dimen/dimen_paddingOverallLeftRight" >

        <com.util.TypefacedTextView
            android:id="@+id/text_userName"
            style="@style/style_Type1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginRight="15dp"
            android:layout_toLeftOf="@+id/text_numchapters"
            android:ellipsize="marquee"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:marqueeRepeatLimit="marquee_forever"
            android:scrollHorizontally="true"
            android:singleLine="true"
            android:text="Welcome" />

        <com.util.TypefacedTextView
            android:id="@+id/text_numchapters"
            style="@style/style_Type2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:gravity="center_vertical"
            android:text="" />
    </RelativeLayout>

    <View
        android:id="@+id/view"
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_below="@+id/title_course"
        android:background="@color/color_seperator" />

    <com.util.BounceListView
        android:id="@+id/list_enrolledcourses"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/footerlayout"
        android:layout_below="@+id/view"
        android:background="#fff"
        android:cacheColorHint="@android:color/transparent"
        android:divider="@null"
        android:dividerHeight="10dp"
        android:drawSelectorOnTop="false"
        android:listSelector="@color/color_listviewselection"
        android:visibility="gone" />

    <include
        android:id="@+id/layout_progressinfo"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/view"
        layout="@layout/layout_progress"
        android:visibility="visible" />

</RelativeLayout>

0 个答案:

没有答案