Android - Set Default Spinner Themes - android-layout

I'm new to Android development.
I'm using drag and drop to pull down a default spinner onto my layout.
However, the default is not the one I see everyone using with the triangle on the bottom right.
An example of what I see is:
http://www.mkyong.com/wp-content/uploads/2011/11/android-spinner-demo1.png
Whereas what I'm looking to achieve is this:
http://i.stack.imgur.com/X82Ld.png
Is it a styling issue?
Apologies for ripping off other people's images, I don't have enough rep for uploading my own images.
Thanks so much!

I've Solved my issue by setting the Theme of the application/activity to Holo.Light. Hope this helps other people in the process.

Related

Broken design and and not clearly visible dash in EnhancedDateRangePicker Vaadin 14 component

There are two problems that I have using the EnhancedDateRangePicker in Vaadin 14(source: https://vaadin.com/directory/component/date-range-picker):
The design is broken when I add the component somewhere in a layout but that happens only when I add a label. If I don't the design is as expected to be. Here is a screenshot to see what exactly happens -
The other problem is that the dash is not visible clearly in this color(light gray I think). Is there a way to change the color of the dash?
Could you please tell me is there any way to make the design as I mentioned in the above two points?
Thanks in advance :).
The problem is solved. It's not the problem with the component, it is actually the Theme which we are using in our projects and the component just overrides the theme styles and that brokes the component. When I put it in a blank page there is no problem. Thanks you all very much for the effort :).

Drawable icons for app

Recently, I've been working for some theming project for Android launchers. I need some guidance and advice from the people around here that could help me with this.
I have created one sample icon for Opera mobile with the size of 192x192. The question is, if I made that icon size as mentioned, should I create another size for it, e.g. 128x128? I'm a bit confused.
Thanks.
I am not sure if understand your question. If you add a drawable resource to Android Studio, it automatically resizes it to multiple sizes. If you have created one, that will be resized automatically.
Hope this helps.
If you want to design icons for android, you better design some for different resolutions. You have to make an icon for each. See at this article https://developer.android.com/guide/practices/screens_support.html#overview. There are the different densities and the multiplication factors.

Android Responsive design using android studio

Hi all !!
I'm newbie to android, Can i get any solutions to make my android app layout that fits in all screens.
If there is any tutorial on it, that would be appreciated !!
Thanks,
Create the following folders in res and add the xml in that
res/layout-small
res/layout-normal
res/layout-large
res/layout-xlarge
And open it from studio layout and make changes.
this link helps you.
The Android resource system gives you the tools to provide alternate resources based on the available width, height, or smallest width — important measurements that serve as the basis for choosing when to change our UI based on the space available.
Width and Breakpoints
Width is perhaps the most important dimension when it comes to choosing when to change your UI. This is because width is the basis for the breakpoint system.
A very good example is here

How to stop other elements moving around when moving an element from relative layout in android studio?

I am new to Android Studio. I am trying to make a basic application that adds two numbers, but each time I move something around, The entire layout gets messed up.
I added a separate View in the center to act as a reference point to counter this, but it is still getting very annoying.
Any idea on how to fix this? I am using Studio version 2.1
If not, is any other way to design the user interface without having to deal with relative layouts?
I have tried linear layouts but those only allow me to place my elements in fixed places which I cannot use in my app.
Please guide me.
Note: I apologize if this question is too simple. I am a newbie after all, do forgive me.
Thanks in advance!
This is indeed the function of RelativeLayout in Android Studio. If you are getting problems with dragging and dropping with RelativeLayout then you should try any other layout. eg. ConstraintLayout
2nd Solution:
Try adding new buttons instead of copying and pasting old ones.
Have you tried using margin: http://android4beginners.com/2013/07/lesson-2-2-how-to-use-margins-and-paddings-in-android-layout/
also look you can align certain object in the xml code relative to eachother, have no link for that atm

Why can't I size android components at will?

Okay, so I'm really trying to do a lab for a class thing and I don't get why I can't have a textbox that takes up the width of the phone and a button that takes up the width of the phone on the bottom, but I don't know why that is? Here's a picture of what I have.
I know this is a noob question but it hasn't been addressed yet on the online course I'm taking and I really need an answer because I wanted android development to be as easy as .NET on windows.
Well anyway here is one picture:
Also here is the other picture:
Notice if I try to make one element bigger, it leads to it pushing the other one out of the activity, I want to have one activity with both elements taking up the entire width of the phone.
Does anyone know what I'm doing wrong?
EDIT: I'm using Ubuntu 14.04 not Mac OS X.
Your controls are children of a LinearLayout with android:orientation="horizontal". This means that the parent ViewGroup is aligning them horizontally; you cannot get the children aligned vertically in this configuration.
If you change the attribute to android:orientation="vertical", you will achieve the result you're looking for.
I strongly suggest getting yourself familiar with the default set of layouts available in the Android SDK by reading this official guide.
Edit : Please refer to this answer for placing views at bottom of the screen.
When you use a android:orientation=horizontal orientation in the layout, the views are stacked/placed in a single row. Since both your views have their width set to fill the screen, only the first one is shown/seen.
What you want is the vertical orientation. This places the views in a single column, one below the other. The width set to fill-parent will allow you the view to occupy all available space.
Official documentation on views : Layouts : Android Dev Docs
Understanding Android Layouts : Techtopia
Android Layout Tutorials : Learn-Android

Resources