I have a row of 5 tabs at the bottom of my app. The problem is the text is cut off on some of them. I want to be able to have the text in each tab stack on top of each other instead of following along horizontally aswell as move the text into the center of the tab instead of sitting at the bottom.
I have created a styles.xml file and have altered the text size but I am not sure how to add the requirments I stated above to it. Can anyone help?
Thanks
The style resources uses the same XML attributes as an XML file. You altered the text size successfully, so just add the attributes for the other desired styles. If you don't know which attributes to use, just go to your XML file and type android: and your IDE should pop up a list of all Android XML attributes. If not, go to the View page and read up on the "XML Attributes" section.
Related
can anyone help with missing layouts?
I used ImageView , however I can't find field layout:row and also layout:columns in the Text or in the properties. missing layouts
enter image description here
There should be two tabs under the Design window, one labeled "Design" and another labeled "Text". In the text tab, you can edit the raw layout xml, i.e. by moving the ImageView's tag(s) to between the <GridLayout .... /></GridLayout> tags. This approach is, incidentally, applicable to most instances of the Design editor refusing to take your orders.
I made an app that displays an AlertDialog once I click on an ImageButton in eclipse.
But when I was trying to input a picture onto the ImageButton, I only found a way to do it in the XML graphic layout of eclipse via right clicking on the Button and then on "edit src". Is there a way to put in the picture from written XML itself?
Yes. You can put a picture into the written xml of an Android layout file.
With your xml file open in eclipse, there are two tabs at the bottom of the layout:
Graphical Layout
.xml
Press the ".xml" tab and you can edit the raw xml.
In order to add an image to your ImageButton, do this:
android:background="#drawable/your_image"
There are also other tags that work too, such as android:src, and the differences are described here: What is the difference between src and background of ImageView.
There are also ways to add the image or change the image programmatically in your .java file. This is useful only if you want to change the image dynamically (although, see below for changes of state)
And, this is just the beginning of what you can do...
If you don't want the default frame around the button, you can use other items, such as an ImageView to make your button.
If you want to display various graphical images depending on state such as "pressed", "selected", etc, then you can specify a "selector" file instead of "your_image". There are many examples of how to make "selector" files on this site, and how to implement the other upgrades to your button.
Have fun!
enter code hereLooking through the Android UI guidelines I came across this section / example:
In the example above, there are a few headers called 'SECTION' with a horizontal line underneath them.
Im still getting grips with the appropriate way to replicate this -
Is there something specific like a Header XML element to use that will automatically style the font and horizontal line? Or is something like this generally more primitive, i.e. A TextView with a 1 pixel horizontal image (ImageView?) underneath it?
Possible duplicate question of this one: Android 4.0 Sub-Title (section) Label Styling
In short: try adding attribute style="?android:attr/listSeparatorTextViewStyle" to the TextView element, which you wish to make look like that, in the XML layout file.
I am trying to edit multiple textview's in a xml layout. Before installing Juno, i was selecting multiple elements pressing shift button and all properties were shown on the Properties view, so i can make batch edits. Now all i have on Properties View;
ID,
Text,
Hint,
Text Color,
Text Appereance,
Text Size,
Content
In this particular case i want to change all their gravities from none to right. I guess i did something wrong with the eclipse preferences or missing something else.. need help thx
I just tested it with Eclipse 4.2.1. I opened an xml layout file, selected a bunch of TextViews, then did a right click and clicked "Properties". All attributes appeared in the properties view and I easily batch-edited them.
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