I am trying to use the Graphical Layout editor to make my app, so far so good but now I am in this problem:
I want the grey small textview to go a little higher but no matter what I do this isnt happening. How do those apps in the market have such beautiful GUIs when I can barely create a simple one? What are they using that I am not? :P Thanks.
Well, To fine tune the UI, you will eventually have to edit the generated XML. It would be good if you start getting your hands dirty with the XMLs. Please post the XML and then anyone would be able to suggest what changes to make.
I think you would probably reduce the padding or margin of the textview above.
Have you tried editing the XML and decreasing the top margin of the text? Or decreasing the bottom margin of the view above the text?
Related
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!
I have a somewhat complex layout.xml file (353 xml lines, 16kb) with multiple nested constraint layouts. This particular xml file is only showing a blank white screen in the design tab but works well when I run it on device and emulator. I have other smaller layout files which show the design normally on android studio but it seems that there is a bug with viewing larger xml files.
Is this a known issue? I tried refreshing layout and removing android studio cache but nothing seems to work. any ideas?
I do not think it has anything to do with the code since it runs normally on device and I am not sure posting the whole xml file on SO is a good idea.
update
What I realised is that all the elements in the layout seem to be 'invisible' at the top left corner since when I hover over them the pointer turns into a hand and when I click , certain elements get highlighted in the component tree. This is a screenshot of what I am seeing:
I added android:visibility="gone" which is vital to my app. Little did I know that it also applies to the design view which I find to be really useless. I want the visibility to be gone during runtime, not on a platform where I am supposed to be tweaking the design of the UI. This is ridiculous to me.
Does anyone know If I can keep visibility="gone" but still see the design in the design view of the layout?
You can use tools:visibility="visible" for designing purposes.
It has zero effect on the view in real use.
Don't forget to keep your android:visibility="gone".
In general, use tools attributes whenever you'd like to manipulate a preview in the designer while keeping your view attributes valid for real use.
Edit:
Keep in mind that there is a huge difference between invisible and gone. More about that
Hi im just starting to make an app, and on eclipse i get 2 tabs. Graphical layout is one of them. I see a black cell phone screen and some buttons and text stuff to put on it. What is this for and how do i use it? Thank you
With the graphical layout you can just drag and drop items in, and the xml is the actual code. Adding things via the graphical layout will edit your code for you, and visa versa. Personally I prefer to just use the xml because the graphical layout can be a little difficult to get the results you want, and it's always useful to have a good understanding of the xml code and how it works.
Android uses XML layouts. They can be a real pain to edit. The graphical layout tab with the picture of the phone is supposed to make it a little easier.
Sometimes you still have to dip down into the XML to get things just right, but the graphical layout will at least give you a preview.
It's your Interface Builder.
It builds interfaces ;)
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/
is there any way how to set text on button not from left to right, but from top to down?
Thanks
As far as I know, that's not possible.
However, if you find a solution I would not recommend using it. You're breaking the common way of how Android applications are meant to be designed. If an Android application is meant to be designed that way, Google would have a way to create a Button like you're describing.
May be you can statically specify button layout_width as some 5 dp or lower...and layout_height as wrap_content so that text will wrap next line..
then use setText..
Hope this helps...
If you create an Image, I mean a .png (and store it in drawable). In this png you store your word the way you want to be displayed. Then set that png as the button background then it may work for you.