Section Header using Android XML? - android

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.

Related

How to show multiple TextView 'inline' layout in Android?

For e.g. I want to show tags to some article (just like we have tags attached with each question on StackOverflow), I would like to show them like this:
Where the tags can be of variable length and they should span across multiple lines if they can't fit in the given width. I tried out LinearLayout and RelativeLayout but they don't seem to be able handle such 'auto' arrangement scenario. What layout or methodology should I use to achieve this effect?
This requirement is known as FlowLayout and I found couple of solutions as open source libraries to achieve this effect:
ApmeM/android-flowlayout
blazsolar/FlowLayout

iOS: How to achieve relative layout

I'm trying to make an iOS version of my Android app. It contains text that looks like this:
There are three labels: title, author, and publication year. I need to display the full title, which may be several lines long. However long the title is, I want the author label to be directly below the title, and the pub. year directly below that.
In Android, I just used relative layouts to achieve this effect. How can I do this in iOS? Can Auto Layout do this for me somehow? If not, do you have any suggestions for effectively displaying this information in iOS? Preferably I'd like to achieve this using the storyboard.
In iOS you use InterfaceBuilder IB for layouts - it's drag and drop - not like Android layouts.
Search for IB tutorials - it is really straight forward and you see what you get:-)
I also searched quite some time a way to achieve android-like layouts in iOS (without the hassle of computing every positions for each subviews).
I eventually gave up and coded a fast equivalent of VerticalLayout and HorizontalLayout. Here's the repo (it's ARC compliant) :
https://github.com/kirualex/iOS-Layout-helper
It's sketchy but it does the work !
Put simply relative layout organises items on the screen relative to something else. Like linear layout, relative layout is commonly used by android developers. I myself do like this layout and have used in the development of my applications before. See
http://developer.android.com/reference/android/widget/RelativeLayout.html and http://developer.android.com/guide/topics/ui/layout/relative.html for more information on relative layouts.

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

styling tabs using styles.xml

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.

How can I make a Android app look pretty?

When I place things like text boxes they are fixed in one position and I can't move them around easily.
How can I edit the style and maybe put an image at the top of the text boxes and give the app a neat and pretty little layout?
Thanks
Use RelativeLayouts instead of LinearLayouts (i assume that you are using them) which allow free positioning.
To modify the theme/colors, read Applying Styles and Themes.
Create 9-patch graphics and assign them as backgrounds.
I am unsure if this is what you are looking for,but you can arrange the object on the layout from the xml files in res/layouts/ folder.Do not forget to follow the UI guidelines provided by google for android development. Also you can create custom themes for you app if you do not like the default template.

Categories

Resources