Customize textview in android - android

I want to customize my textview as per my requirement. I have to add padding or margin dynamically when text is too long and it should look like my screenshot which I have attached here. Can anyone help me how can I implement it and below is my screenshot.

Try using this. It is customizable.
I used it so that I can have different color texts inside my "textview" , and also I used it, cause I did on it a code to resize the text size, so that it fits in the screen height. But if that was possible, I'm pretty sure what you want to do is also possible.
https://github.com/DavidPizarro/AutoLabelUI

Related

FragmentDialog different design of UI

I try launch samples as this link, but I have different design of UI. I have this:
But I want have new design as this:
I launch my project on simulator with android api 14.
How can I use the new design as last image?
#WebnetMobile.com friend u can have this view by using a list view and then using a style such that editText element must have width fill parent and hint must have a style element and this elemnt style should have the gravity of 1 and and top left with text size small as u needed (keep looking in your xml and fit it accordingly). also for text color use color:# for hex code u can see on internet to find out the hex code of your desired answer

Android: EditText design

I have an EditText view which I need to look like below (focused and non-focused versions).
Also I have two following images:
Can I somehow just set these images as a background to make EditText look like above, not depending on its width? Or do I need to create some additional image files? Or some other solution? I'm a complete newbie in designing UI, so I'd appreciate any help and any comments on subject.
You first need to create a 9-patch graphic for each of your images. These specify how the image is stretched, and how the content is padded.
Then, you need to create a selector xml drawable to use one image or the other, based on the EditText state.

How do you rearrange buttons where you want them in Eclipse?

Hey guys I am having trouble with placing my buttons in my XML layout. I already have a background and was just trying to put 3 buttons near the middle and thats where I'm having trouble. I know about center gravity and all that but could you help me? Also, If I made my own buttons can I just import them using the image button thing, or is that not right? Thanks for the help!
PS: Also, there is a big white box around my button. How do I get that to go away?
I posted this answer to your duplicate question, so I'll also post it here. :)
You can rearrange elements of your layout by editing the XML directly or by dragging and dropping in the outline view or the graphical layout view (I find the latter harder to do reliably).
To use your custom views, click on the "Custom & Library Views" button in the graphical layout palette, or just type in the fully qualified class name as the view tag in the XML.
If you use Image button you can set your custom Image to src property or background property. If youi chose src you should add android:background="#null".
But I would recommend to use background property while if you use 9-patch png (who knows maybe tomorow you will use 9-patch) they would not stretch if you set it in src.

Want help to make Android layout same like attachd image

I am getting stuck with making android screen layout same like i have in my iPhone application. The iPhone screen layout is given in below image. Please anyone can help me out to make same screen for android. You can give me some idea with having some code snippet please.
Thanks in advance.
First off, you should be creating an XML-based layout. The Android SDK has a graphical layout tool that will help you with that.
Start looking into 9-patch images for your custom button graphics and setting your android:background attribute to them within a <Button />. Make sure you use actual text for the buttons, not graphics of the text. You should probably use a <RelativeLayout /> for the main layout, as that will let you target multiple screen sizes easily without a mess of nested <LinearLayout />s.
For the tinted area, just use a translucent PNG (with an alpha channel) instead of attempting to line up graphics.
use relative layout to design this screen like use image for navigation bar and align it as parent top (use no title bar in mainfest) add its listener
similarly you can align other text and image view

Combining EditText and Button?

In some apps I see an EditText widget combined with a Button on the right side (e.g. the search field in the twitter app).
How can I create a widget like that?
Regards,
Marco
I finally found a solution.
Here's how the google guys did it: search_bar.xml
Thanks for your help!
Check out the TableLayout and the RelativeLayout in the Android developer center.
There are a few more official tutorials on layouts here.
If you use the TableLayout, you can put an EditText in the left column of a two column layout, and then put the button on the right. Or, probably a better way, would be to use a RelativeLayout, which gives you a little more flexibility.
Take a look at Applying Styles and Themes and the Draw 9-patch tool. 9-patches are used as the background for widgets like EditText and Button. You can combine a custom widget background with padding and margins to get the effect you want.

Categories

Resources