Button containing images and text - android

I have to create a small panel like thing with a border.
This should contain a text, an image that describes the text and a button.
On clicking that button I have to do some operations also.
Which widget is suitable for this?
Can anyone suggests any idea?

ImageButton is what I can think of. Try the ApiDemo sample application comes up with android sdk too. Another tool you might need is DroidDraw (Free android UI designer) and hierarchyviewer.bat(inside android sdk tools) can also help you if you want to know how the other developers use for such purpose.

I have assumed that you want to display button with images + Text,
You can do it with Button. There are 2 ways to do it(Button with Image and Text).
By xml, you can set
android:background attribute of
button and the text which you set,
will be appeared above the
background.
By code, You can use
setBackgroundDrawable() , it is
used to set the background of a
button.
and If you want to display panel(By clicking on the handle of that panel, it will comes up with the many items as home screen) , slidingDrawer widgets is the best solution.

Related

Which button when to used and which one is better practice to used in flutter

There are buttons out there in flutter, i am clear when to used TextButton but others button i don't understand to use it.Which one is better to used for better practice.
TextButton (older one - FlatButton) - mainly for showing text with button tap effect.
ElevatedButton (older one - Raised button) - shows the real button with tap effect.
OutlinedButton (older one - OutlineButton) - as the name suggests, it shows outline of the button with text and tap effect.
RaisedButton is deprecated, so please don't use it. Its updated alternative is ElevatedButton. We also use TextButton. If you wish to show any icon type Button, then use IconButton and customise the button shape.
Often I use a container and Widget like InkWell.

How to create a field whose text changes in android

I am just starting with android. This is what i want to make:
Now when you click on From, a new screen would open where you can select places and once you select you will get back to this screen where instead of "Bangalore" it would be the place you selected.
What kind of a field is this ? Text field ?
Also if i want to add any effect like when you click on it its color changes, how would i go about it ? Any tutorials or documentation i can check out for this.
Yes, you will probably want to use TextView.
You can change the text it displays by using SetText(), and you can change the text color by using SetTextColor().
You need a TextView to display text, but if you want to display an image, text and be able to interact with that, then Button or ImageButton is what you need.
Your question is too broad, so I encourage you to start doing some tutorials. To implement all that stuff you'll need to learn about layouts and activities, dialogs, listviews, ... Basic Android, but it needs a minimum of experience.

How to make in Android EditText with Button like in iOS?

Can I do something similar with image below in Android default way?
See example image here
Yes, you make your editbox with correct graphic and then you put another button beside it.

showing text and image both while displaying list of applications in android

i want to create a home screen application where the applications looks like carousel , and i am able to do it . The problem i am facing is that in my application only the applications icon are getting displayed the text is missing in it , where as my requirement is that i want to both the icon and text to be displayed together.
my application displays same as the above showing image.
i want text to be combined with it as above image.
please help me.
Thanks
datta
So the simplest thing to do would be to create a Compound Control. This compound control would essentially be a LinearLayout with both and ImageView and a TextView in it. Then, where ever you use a CarouselImageView in your code, just use your new compound control instead.

Android: How to change a button so that it has a graphic image embedded on it

I have a program that I'm writing in Android using Eclipse. It has an array of buttons (4x4).
I would like to have the buttons contain a user defined image (perhaps some filled circles).
How do I go about doing this?
Thanks
Mike
http://developer.android.com/resources/tutorials/views/hello-formstuff.html#CustomButton
Should be straight forward enough to follow.. if the image is chosen by the uesr, you will just have to change the image path on a button press or something similar

Categories

Resources