All controls stacked on top of each other - android

I'm just starting to learn how to develop Android apps and when I tried to finally test an app with the emulator, the TextView, ImageView, and Button controls all seem to be stacked on top of each other at the top of the screen. I formatted the controls with the simple drag and drop feature in Android Studio. How do I fix this?

Tool you are using is called Layout Editor which is not so great for building layouts actually.
That drag-n-drop creation can cause errors like that and you should probably start from here or here
Hint: as a parent layout you most probably (in this case) use LinearLayout with vertical orientation.
Good luck!

The best practice for you is to try to follow a tutorial or a course to get a better understand of how the user-interface works in android.
That's might be useful Android Basics: User-interface
Good luck!

Related

How to design live tiles in android like Windows phones?

Is there any way we can design a live tiles in android like windows phone? If so can you please guide me
hello you have to look at android design principles ,
just look at this link
You can use fragments for mimicking live tiles in android!
The container for the fragments should be dynamically created frame layout or any other layout.
You can add a long click listener for these layouts, to show options like unpin,re-size as in windows.
Add a drag listener too, so that the user can freely drag and drop the view any where within the parent layout.
I hope this idea is pretty clear.

How to create an Google Currents like layout

Does anybody know how the article layout in the Google Currents Android app is built? I'd like to use some very similar layout for my app.
Example:
The first thing which came to my mind was to build up an the layout with a WebView with multicolumn stlye (http://www.w3.org/TR/css3-multicol/). Am I on the right way or is my suspicion completely wrong.
How do I get the page flip through the swipe/fling gesture and how to get the corresponding page indicator at the bottom?
Thanks in advance! :-)
You must use native views android and not webView because it is not efficient. But if you begun on Android you can actually use a webView is a good learning.
However, if you're interreses the layout android http://developer.android.com/ the website is a very good teaching technique. And what is the view of pourfaire text scroll from right to left, I encourage you to use the library ViewPagerIndicator.
I hope I have helped you!

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.

Android GUI Layouts in Eclipse

I am very new to Android development and am having some trouble. I am creating an XML file using Eclipse, both the Graphical Layout feature is what I'm having trouble with.
Also, I am working in Android 2.3 for compatibility reasons.
I am wondering if there is a layout which enables me to place buttons or text fields or any attribute where I want to put them. This may sound stupid, but it seems that every layout has some sort of order in which it lets you add attributes, and whenever I try to drag them elsewhere on the layout things just get very very messy.
If what you want is an AbsoluteLayout, this has been deprecated since Android 2 (IIRC). You can try using the RelativeLayout, which let you position freely your widgets. Else, if you only use LinearLayout, then yes the widget will be positioned in a strict way.
use Relative Layout. I recommend that you read up on Android layouts so you understand why, what and hows of Android way. There are some good tutorials that I found helpful. TutsPlus: Android Layouts
There is also a very good video from Marakana.
Marakana: Android Bootcamp
If you are just starting out with Android check other tutorials/videos on Marakana. They are a very good resource for beginners.

My Relative Layout Design shows messy view of my widgets in graphic Layout view (Layout Editor) but it works well in emulator

I am trying to develop a RelativeLayout in the Layout Manager of Eclipse(Galileo) with Windows XP
My RelativeLayout consists of
some TextViews
some LinearLayouts , each Layouts in turn contains some Buttons and TextViews
I have arranged it with the reference id one below one using property:
"layout Below & Layout above etc.,.
But in Layout editor it is showing some messy type and it looks fine in Emulator
How can I arrange it well and good in the Emulator itself.I have spent some 2 days for this. can't get anything
Is this a system error? Or, are there any techniques to handle the RelativeLayout?
Guide me.
Thanks in advance !!
https://docs.google.com/open?id=0B_W2CaYMJagaZTVjMzY1YmMtMDE2My00OGQzLTkxMTEtMmYwMTVkNzFhZTgz
https://docs.google.com/leaf?id=0B_W2CaYMJagaZTFiMTRkYWUtNDYwNi00YjY3LWI3MjctY2NkZWFjYjI3MjNm&hl=en_US
This is the Url I have posted my screen shots.. for Your reference
It is the same situation for me trying to design relative layout with eclipse. Try to post your question on Eclipse forum . It's not important issue for me, but if you'll find the answer - it would be great.
The layout editor is not really all that reliable, especially for relative layout. It's nice for some simple layouts, but a lot of the time with more complex layouts it won't render correctly. If you're doing anything complex, you pretty much have to get a feel for the XML elements, use them to the best of your ability, then try in the emulator (or on a device).
Also you could use tools for layout creating.. for example http://www.droiddraw.org/

Categories

Resources