android - Making the textSize adjust to the EditText -


i have code:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     tools:context=".mainactivity" >      <edittext         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="1"         android:hint="@string/tip_value" />      <edittext         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="1"         android:hint="@string/tip_value" />      <edittext         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="1"         android:hint="@string/tip_value" />  </linearlayout> 

outcome of code above

how can make textsize adjusting height of edittext ?

i mean uppercase letters span whole height of edit text (which different sizes because of linearlayout)

thanks in advance.

you need check height of each view inside listview , define text size specific view. have use custom adapter show array or arraylist (or cursor...) in listview. in custom adapter under getview() can convertview.getheight() exact height of specific view in pixels, , set textview size view in getview(). should similar this: (i haven't checked code i'm writing example)

public view getview(int position, view convertview, viewgroup parent) {     .     .     .     view line = convertview;     float size = line.getheight();     textview text = findviewbyid...     text.settextsize(size-20);     return line; } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -