Let CodeIgniter's ellipsize () support the Chinese truncation method. The TextHelper of CodeIgniter has an ellipsize () method, which is used to filter HTML tags and intercept text. However, it is particularly difficult to support Chinese characters.
Android: Use of ellipsize, androidellipsizeIf the content in EidtText and textview is too long, it will automatically wrap. android: ellipsize and android: singleine can be used to solve this problem, so that there is only one line.EditText does not
CodeIgniter's Text helper has a ellipsize () method for filtering HTML tags and truncating text. But it is particularly bad for Chinese support, in the use of Chinese is garbled.
Below has the netizen to make the function ellipsize () to carry on
When using TextView, The ellipsis is automatically displayed if the length is too long. native support is available in android, which is defined as follows:
Copy codeThe Code is as follows: Android: ellipsize = "end"
Android: singleLine = "true"/>
In the development process, we want to see the TextView content is too long word wrap, but call measuretext function found that the return value is not accurate, the unit is not sure, is pixel or dip, are not allowed. Later think of TextView in a
Resources:http://blog.csdn.net/huiwolf2008/article/details/7901084Http://www.cnblogs.com/Gaojiecai/archive/2013/06/18/3142783.htmlIn TextView and EditText, you can use Ellipsize to set up text overflow hiding, such as: "A long text ..."Use the
Ellipsize is mainly when the TextView text is too long, we can let it display the ellipsisUse the following:in XMLellipsis at the end -android:ellipsize = "End"ellipsis at the beginning -android:ellipsize = "Start"ellipsis in the middle
This article describes a workaround for the Android TextView multi-line text (more than 3 lines) using the Ellipsize property invalidation problem, and a friend who needs to refer to the TextView property in the layout fileCopy CodeThe code is as
In the Android system, textview must meet the following conditions to achieve the running horse effect: 1. Android: ellipsize = "marquee" 2. textview must be displayed on a single line, that is, the content must be larger than the textview size. 3.
When using TextView, you need to automatically display an ellipsis for an extended length, and there are native support in Android, defined as follows:
Copy Code code as follows:
Android:ellipsize= "End"
Android:singleline= "true"/>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.