Adding button to layout and it will not show up - layout

I'm adding a button to a linear layout and it does not show up. Main XML after adding button last button:
Preview button does not show:

I use AIDE as well, it isn't quite reliable. Nor is its Design preview. So, basically, if your codes are correct just build the app and see what happens.

There are no place for the third button.
Reduce string length in android:text of all buttons and check that button appears, or make linearlayout orientation vertical and check.
You must learn about "weight" attribute...

Related

Vertical Radio Buttons

So what is the best method to get vertical radio buttons to display in situations with limited screen space. I started with the standard xp:radioGroup, but I can't control the format to be vertical.
I have tried the multicolumnradiobutton on OpenNTF, but I was having problems getting an eventHandler to fire to force a partial refresh (tried using onclick). Would love to see a sample of that since that would solve the issue of formatting.
What I am seeing at this point is if you use a radiobutton group you are stuck with a horizontal layout of buttons. I haven't looked Dojo Radio Button to see if it was the answer.
Basically best option for vertical list of radio buttons that will allow partialRefresh of document.
You get vertical radio buttons with xp:radioGroup when you set layout="pageDirection":
<xp:radioGroup
id="radioGroup1"
value="..."
layout="pageDirection">
...
</xp:radioGroup>
You can use a radio button (not a group) and tie them together with the name. Then you can format them any way you want. This is useful when using Bootstrap since the radio button group puts everything in a table.

Expanding button to autosuggestbox in UWP

I am trying to configure a button within my UWP app to expand in to an AutoSuggestBox on click. This behavior is mentioned in this post:
https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/search#Implementation
I tried utilizing a flyout on the button click, but it doesn't give me the desired effect. Is there an existing control that can do this or will I need to roll my own XAML of an existing control?
The behavior you see in the blogpost can be easily achieved by having an autosuggestbox hidden behind the button, then after on button click fading out the button and resizing the autosuggestbox to the desired width.
There's no way to "expand" a control into a different one, but you can make it look like that happens :)

fltk widget order, button is hide under another widget

I am using fltk 1.3.2.
I have two widgets, one of them is Fl_Multiline_Output and other one is Fl_Button.
The button is a place on the the multiline_output.
When I click multiline_output, the button is disappeared.
I need to use always on top like speciality for my button.
It mustn't be hide.
Does anyone know fltk support this?
I have changed Fl_Multiline_Output to Fl_Text_Display, I put the text and deactivated it. Now, when I click Fl_Text_Display nothing is happen.
I changed to Fl_Text_Display because if I deactivate the Fl_Multiline_Output object, text color is changed. I chose Fl_Text_Display there is no problem with text color.

How to add gravity for button CompoundDrawable in android?

I am developing android application with some custom views. Here i am adding buttons with CompoundDrawable in one of my view. Here i am giving CompoundDrawable for buttons to give bullets effect for the text. But i am facing problem with CompoundDrawable alignments.
If my button text is single line then alignment is showing good. Button text is more that 2 line that will show my bullet in incorrect place. At any way i would like to show my bullet CompoundDrawable at left-top of my button text.
Here is my button creating code
Button button = new Button(this);
button.setLayoutParams(myParams);
button.setCompoundDrawablesWithIntrinsicBounds(drawableId, null, null, null);
button.setBackgroundResource(0);
button.setGravity(Gravity.LEFT|Gravity.TOP);
But it is not showing my button what i would like to show.
I have attached image of my buttons. On that 1 is proper. but i would like to show 2, 3 also same like button 1.
Please look on attached image.
Thanks in advance.
make use of android layouts........

How do I get action buttons with custom layouts to be styled like standard action buttons in Android 3.0+

I'm having a bit of trouble with custom action buttons in the honeycomb+ action bar. I'm adding a menu item that uses a custom layout (using the android:actionLayout attribute). The reason for the custom layout is that I want a button that has two lines of text that can be updated dynamically.
However, I still want this action button to operate like the other standard buttons. By this I mean that the background fades in when the button is selected, and fades out again if it is unselected, all in the style of the platform (the colour seems to differ between different platforms/devices - I've seen both grey and blue versions)
I've tried using the action button style for the custom layout:
style="#android:style/Widget.ActionButton"
and I've tried setting the background for the custom layout to:
android:background="?android:attr/actionBarItemBackground"
but to no avail, and I'm kind of trying things fairly randomly as I can't find any documentation on how to do this (or if indeed it is even possible).
I know I can approximate this behaviour myself by setting the background, but it would be nice if I could just set the item to behave like a normal action button in terms of how it appears when the user interacts with it.
Anyone have any ideas?
Thanks in advance!
Ah, sorry to answer my own question but I have just stumbled upon a way to do this. I was halfway there - you need your custom layout's style to inherit from ActionButton:
#android:style/Widget.ActionButton
but then you also need to make the layout clickable:
android:clickable="true"
for it to work. Using both of these makes the custom action buttons look just like the regular ones when you press them.
Hopefully that'll help someone trying to do this!

Resources