AbelJoo / SmartHintTextView

在Android原生TextView中,当text长度小于hint时,TextView右方会占据多余的位置。该项目解决了此问题。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to SmartHintTextView!

在Android原生TextView中,TextView的宽度是由text和hint共同决定的。当text字符长度小于hint时,TextView右侧则会出现一段空白,此处空白正是由于被隐藏的hint占据所导致。总而言之,原生TextView的宽度由text和hint字符串最长的一个决定的。

该项目解决了此问题。当text长度小于hint时,SmartHintTextView右方不会占据多余的位置。


举个栗子

enter image description here


博客

Abel Joo


Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

在Android原生TextView中,当text长度小于hint时,TextView右方会占据多余的位置。该项目解决了此问题。


Languages

Language:Java 100.0%