gpt4 book ai didi

android - 如果 android :inputType ="textCapSentences" used in textview,椭圆大小不工作

转载 作者:行者123 更新时间:2023-11-30 00:38:48 26 4
gpt4 key购买 nike

        <TextView
android:id="@+id/lbl_search_string"
android:text="sdsdf kjnknlkn kjnlknln lknlnln lknlsnln lkjnlkjj hbhbhb hbhbh "
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#333"
android:textSize="@dimen/txt_18sp"
android:inputType="textCapSentences"
android:paddingLeft="@dimen/dimen_5dp"
android:paddingRight="@dimen/dimen_5dp"
android:scrollHorizontally="true"/>

在上面的 TextView 中,如果我删除“inputType”,那么 ellipsize 会起作用,而如果我添加“inputType”,则 ellipsize 不起作用。

我需要在同一个 TextView 中同时使用 ellipsize 和 inputType="textCapSentences"

最佳答案

android:ellipsize

If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. You will often also want to set scrollHorizontally or singleLine as well so that the text as a whole is also constrained to a single line instead of still allowed to be broken onto multiple lines.

android:inputType="text" 

不要

android:inputType="textCapSentences"

关于android - 如果 android :inputType ="textCapSentences" used in textview,椭圆大小不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42904005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com