Setting a TextView width in java
How can I set the TextView properties like width, height using Java Code? ...
How can I set the TextView properties like width, height using Java Code? ...
I have a multi-line TextView that has android:ellipsize="end" set. I would like to know, however, if the string I place in there is actually too long (so that I may make sure the full string is shown elsewhere on the page). I could use TextView.length() and find about what the approximate length of string will fit, but since it's multip...
Hi all: I'm writing a class that inherit from TextView, and override its onDraw() method, but in the method, my invoke of canvas.drawText() doesn't seems to work, the code just like below: protected void onDraw(Canvas canvas) { // super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.WHITE...
Hi, I have a lsit view and i that i need to add some text. in the adapter, the textview i used is <TextView android:layout_marginLeft="10dp" android:layout_width="wrap_content" android:gravity="center_vertical" android:layout_gravity="center" android:maxLines="3" android:layout_height="70dp" android:textColor="#000000" andro...
I'm using shape attribute like this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#FFFFFF" /> <corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp" android:to...
I have inflated a View into a PopupWindow. This View includes a TextView where I want to place text at runtime. I need to count the number of lines the TextView uses in order to adjust the size of the pop-up. For this purpose I use TextView's getLineCount() and draw the TextView before counting the number of lines ( myTextView.draw(canva...
text = text + CepVizyon.getPhoneCode() + "\n\n" + getText(R.string.currentversion) + CepVizyon.getLicenseText(); activationText.setText(text); myTextView.setText(text); I want to change color for CepVizyon.getPhoneCode()'s string... how can I do this?? ...
I have a list view holding text views and when the text gets too big, it wraps and the item takes up two spaces. I am wondering if there is a way to turn off line wrap in this case, and if it should be done in the textview or the listview. ...
I have a TextView I use to display email addresses to my users <TextView android:id="@+id/profile_email" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="6dip" android:textColor="#0...
Dear people, I am trying to build an android application for a message board. To display formatted html for the post contents I have chosen the TextView and the Html.fromHtml() method. That, unfortunately, covers only a few html tags. The unknown tags are handled by a class that implements TagHandler and has to be generated by myself. ...
I have a context menu on a TextView representing a user name in my app. When the context menu appears I want to have certain options such as "View Statistics" etc. The context menu is appearing fine and everything is working great except it's adding "Input method" to the context menu and I do not want it there. It's irrelevant to what th...
Hi, I have got a tech problem of implementing the reflection effect for TextView, in order to create a Clock/Timer. I have read many articles about this, but they are all about adding reflection effect for Images. Would anyone please point me to the right direction to do so or simply show me some demo which are already there. one of t...
I'm using the FontFitTextView that was posted in this other thread, but it isn't working exactly right for me. The measureText() call is returning a number that is obviously too small to display the string. When it runs through to find a font size that will allow the text to fit, the font size it settles on is still too big. I feel like ...