How to add a spinner icon to button when it’s in the Loading state?

Twitter Bootstrap’s buttons have a nice Loading… state available. The thing is that it just shows a message like Loading… passed through the data-loading-text attribute like this: <button type=”button” class=”btn btn-primary start” id=”btnStartUploads” data-loading-text=”@Localization.Uploading”> <i class=”icon-upload icon-large”></i> <span>@Localization.StartUpload</span> </button> Looking at Font Awesome, you see that there’s now an animated spinner icon. I tried to … Read more

How to remove outline border from input button

When I click somewhere else the border disappears, I tried to use onfocus: none, but that didn’t help. How to make this ugly button border disappear when I click on it? input[type=button] { width: 120px; height: 60px; margin-left: 35px; display: block; background-color: gray; color: white; border: none; } <input type=”button” value=”Example Button”> 16 Answers 16

Cannot lower case button text in android studio

I have a trivial question that has been bothering me for a while. I tried to google this but no one seems to have the same problem as me or doesn’t see it as an issue. When I make a button in activity_my.xml under layout <Button android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”@string/button_1_name” android:id=”@+id/button2″ android:layout_marginTop=”140dp” android:layout_below=”@+id/textView” android:layout_centerHorizontal=”true” /> I … Read more

Disable form auto submit on button click

I have a HTML form where I use several buttons. The problem is that no matter which button I click, the form will get submitted even if the button is not of type “submit”. e.g. Buttons like :<button>Click to do something</button>, result in form submission. It’s quite painful to do an e.preventDefault() for each one … Read more

How to pass arguments to a Button command in Tkinter?

Suppose I have the following Button made with Tkinter in Python: import Tkinter as Tk win = Tk.Toplevel() frame = Tk.Frame(master=win).grid(row=1, column=1) button = Tk.Button(master=frame, text=”press”, command=action) The method action is called when I press the button, but what if I wanted to pass some arguments to the method action? I have tried with the … Read more

How to Set Opacity (Alpha) for View in Android

I have a button as in the following: <Button android:text=”Submit” android:id=”@+id/Button01″ android:layout_width=”fill_parent” android:layout_height=”wrap_content”> </Button> In my onCreate() event, I am calling Button01 like this: setContentView(R.layout.main); View Button01 = this.findViewById(R.id.Button01); Button01.setOnClickListener(this); There is a background in the application, and I want to set an opacity on this submit button. How can I set an opacity for … Read more