How to align children items in canvas to print with gridspan |
Setting Grid.SetRow and Grid.SetColumn attached properties works only if
specified object is wrapped in Grid. In your case your mainCanvas1 and
mainCanvas are wrappep in mainCavasFinal. So only mainCavasFinal is
affected by Grid attached properties.
If you want to use Canvas container you can manage its children position
using Canvas methods:
Canvas.SetLeft(mainCanvas, 100);
Canvas.SetTop(mainCanvas, 100);
or you can pring Grid itself, see: Print Grid which generated dynamically
in wpf
|
How can I right align the +1 button? |
Try this to use span for your g-plus button then put it inside a div, then
align the div to the right....
<div class="g-plusone" data-annotation="none" align="right">
<span>
<!--your content-->
</span>
</div>
|
Not able to align button to the right in xml |
Add a spacer view:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top">
<com.aavishkaar.quikies.widget.TypedfacedTextView
xmlns:your_namespace="http://schemas.android.com/apk/res/com.aavishkaar.qui"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Bluetooth"
android:id="@+id/textView"
android:textSize="24sp"
android:textColor="@android:color/black"
android:gravity="center|left"
android:layout_marginLeft="15dp"
your_namespace:typeface="Roboto-Regular.ttf"
android:singleLine="false"
/>
<!-- ADD THIS BELOW -->
<View
android:layout_width="fill_
|
trying to align simple_form box and button |
Can you post your output HTML? By default, these fields will align
correctly, so you don't need all the floats and margins.
http://jsfiddle.net/gpnZS/
<div id="search-box">
<form>
<input type="text" class="search-control" value="Search me"/>
<button class="submit">Submit</button>
</form>
</div>
If you need more than this, check out the display: inline-block property.
|
Align a button at the down-right of an input |
Why don't you use CSS? Use something like this:
<div id="outer-container">
<div id="container">
<div id="label">Your Label<input id="input" /></div>
<div style="height:10px"> </div>
<div id="button">Your Button</div>
</div>
</div>
CSS:
#outer-container{
padding: 20px 20px 20px 20px;
width:500px;
height:200px;
background-color:#eee;
}
#container{
width:300px;
height:100px;
margin: 0 auto;
background-color:#ccc;
}
#label{
float:right;
}
#button{
float:right;
}
No magic here. Just regular formatting. Just don't be afraid of div-tags.
Maybe you need more containers around your mask.
See the fiddle: http://jsfiddle.net/Ahg5c/1/.
|
Right align position of a button |
may i sure try this give button style float:right;
http://jsfiddle.net/aJDXb/1/
<a style="text-align:right;" href='@Url.Action("Index", "Route", new {
id = Model.ID })' class="align:right;">
<button style='float:right;'>Print Preview</button>
</a>
|
button ignores parent div and won't align |
If you want to place only that element into the center, this could be a way
to go:
#button-subheading {
position: absolute;
left: 50%;
top: 50%;
height: auto;
width: auto;
text-align: center;
margin-left: -150px; /* half the width of your element */
margin-top: -150px; /* half the height of your element */
}
FIDDLE
|
How to align a button to the right of text box without margin? |
put this in a paragrapgh tag and there no need for float:left
<p><input type="text" value="" placeholder="search text here"
style="display: block; width: 100px; height: 32px; margin: 0px;
padding: 0px;" />
<input type="submit" value=" OK " style="display: block; margin: 0px;
width: 20px; height: 32px; padding: 0px; " /></p>
|
How to align the text in the button to the center? |
you can try adding the following style to your button:
style=
"font-family: Arial, Helvetica, sans-serif;
font-weight: normal;
color: #444;
min-width: 90px;
padding:5px;
margin: 5px 10px;
background-color: #fdfdfd;
border: 1px solid #cdcdcd;
cursor: pointer;
border-radius: 3px;"
|
Center Align Submit button |
Wrap the input with some element and text center align the input.
<div id="form">
<form method="post" action="google.php">
<textarea rows="3" cols="40" style="width: 300px; float:
left;"></textarea>
<span class="right" style="width: 278px; float: right;
text-align:center;"><input type="submit" display:inline-block;
/></span>
</form>
</div>
http://jsfiddle.net/UuFg2/
|
Javafx Image and Text align on Button |
You have to use button.setContentDisplay(ContentDisplay.TOP);
ContentDisplay
|
How to bottom-align my button bar in Android LinearLayout |
You can use RelativeLayout here, but nested layouts are not a big deal when
used this way. It will only be inflated once. Your Detail LinearLayout
should look like this:
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:orientation="vertical">
<FrameLayout
android:id="@+id/documento_detail_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:weight="1" />
<LinearLayout
android:id="@+id/documento_twopane_buttons"
style="android:attr/buttonBarStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
|
Align button vertically in alert field |
When you use pull-right, Bootstrap is applying float:right. This removes
the element from document flow, meaning that it will no longer affect the
height of its parent container. This is the first thing you need to fix.
There are a few different methods, but my favorite is applying
overflow:auto to the parent element.
Now that this problem is solved, you still have to deal with the fact that
the line height of the text is not the same as the height of the button. To
fix that, simply assign the line height. In this case, the button has a
height of 36px, so you can use line-height:36px.
Here's some working code (and here's the updated fiddle):
HTML
<div class="alert alert-info">
Text on the left
<a class="btn btn-default pull-right" href="#">Link</a>
</div>
CSS
|
responsive menu toogle button align |
I did not get your question properly. But it you want it to float left or
right. Based on the image you provided, it will be like :
#toggle {
margin-left: auto;
margin-right: 0;
width: 50%;
}
Give some width,which you like.
|
Align CSS Button in Center and add Rounded Corners |
On line 29 you set the float of the button to left. Change this to
text-align:center;, and the button will be centered
#cssmenu > ul > li {
text-align:center;
}
Then, if you target the a, you should be able to get the border radius to
change.
#cssmenu > ul > li > a {
border-radius:10px;
}
Fiddle
|
In VB.Net, when using a CheckBox with a Button appearance, how can you truly center-align the text? |
Here is an idea:
Make them actual buttons and toggle the text from "Show XYZ" to "Hide XYZ"
when the user clicks the button, that way you will actually have proper
buttons that will center correctly for you.
Alternatively, consider making a ToolStripButton hosted inside of a
ToolStipContainer to create a toggle button effect, which could nicely be
displayed above the results of the Load button. Read the answers for
ToggleButton in C# WinForms.
|
How to align the validation errors for radio button and checkbox |
Quote OP:
"if nothing is selected the error message is displayed in between the two
radio buttons."
This is the default behavior. The message (<label>) appears
immediately after the first radio or checkbox in the group.
You would change its position using the errorPlacement callback function.
Check to see if it's a radio or checkbox first and position it accordingly.
This is the default callback...
errorPlacement: function(error, element) {
error.insertAfter(element);
}
Within your .validate(), do something like this...
errorPlacement: function(error, element) {
if (element.attr("type") === "radio") {
// your custom position
} else {
error.insertAfter(element);
}
}
Quote OP:
"Along with this issue i tried range option for phone nu
|
How to align text input with sorting button inside | ? |
Float the clickable element to right, wrap the input by a division and set
a margin-right to it:
CSS:
input[type="text"] { width: 100%; }
.wrapper { margin-right: 25px; }
.clickable { float: right; }
HTML:
<a class="clickable" href="#" onclick="/*call myFunc*/"
>▲</a>
<div class="wrapper">
<input type="text">
</div>
JSBin Demo
|
How to create a button on top of ImageView and align it to the bottom of the screen? |
You can put them in their own RelativeLayout, then you can manipulate the
location of the button relative to the ImageView quite easily.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@id/filter_linear_layout" >
<ImageView
android:id="@+id/filter_image_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<Button
android:id="@+id/display_RGB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_blue_red_transluscent"
android:text="@string/display_RGB"
android:textColor
|
How to align `button-group` horizontal in the centre of the column div? |
Make the ul fit to the li's using display: inline-block and then give
text-align: center to the parent element of the ul tag.
.large-12.columns { /* applies to the div which has the both classes */
text-align: center;
}
ul.button-group{
display: inline-block;
}
Working fiddle
Working fiddle (using display: inline-block to li's)
|
Unable to align text and button in dialogbox in javafx |
Use an AnchorPane instead of a StackPane. Then you can position any node by
static methods in AnchorPane class.
AnchorPane pane = new AnchorPane();
...
AnchorPane.setLeftAnchor(textWarning, 50.0);
AnchorPane.setLeftAnchor(btnDialog, 50.0);
AnchorPane.setTopAnchor(textWarning, 20.0);
AnchorPane.setTopAnchor(btnDialog, 50.0);
...
pane.getChildren().addAll(textWarning, btnDialog);
...
sceneDialog = new Scene(pane, 150.0, 250.0);
...
|
align button items on top of a table with twitter bootstrap |
I would give the next-day button a class of pull-right (a bootstrap class)
and the date field a class of center (custom class) where center is defined
as
.center {
float: none;
display: table;
margin: 0 auto;
}
Think that should work
|
Does a Facebook canvas app need a login button? |
Is checking response.status necessary? Can a user ever access a Canvas
app without being logged in?
Of course they can.
Does a Facebook canvas app need a login button?
If you want the user to connect to your app, then yes of course.
For handling login within a canvas app, I’d recommend using FB.login.
|
Clear canvas in button click |
import android.graphics.Color;
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawColor(Color.TRANSPARENT);
for (Path path : _graphics) {
canvas.drawPath(path, mPaint);
}
}
or
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
mPaint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
canvas.drawPaint(mPaint);
mPaint.setXfermode(new PorterDuffXfermode(Mode.SRC));
for (Path path : _graphics) {
canvas.drawPath(path, mPaint);
}
}
See this Doc for more info.
Your clear method is wrong.
public void clear(View v) {
((DrawingView)mView).clearView();
}
|
Bootstrap 3 - Align font-awesome icon inside button vertically |
Set both elements to display inline-block and then set the span to take up
a percentage of the space. In this case 90% / 10% seems to work good.
span {
vertical-align:middle;
display:inline-block;
width:90%;
}
To remove the padding you can do this: (probably want to add a some left
padding)
.btn-foo1,
.btn-foo2 {
padding:0;
border:0;
}
Change display to inline block, and remove right float:
.btn-foo1 [class^="icon-"],
.btn-foo2 [class^="icon-"],
.btn-foo1 [class*=" icon-"],
.btn-foo2 [class*=" icon-"] {
background-color: red;
display:inline-block;
vertical-align:middle;
padding:24px;
width:10%;
}
Demo:
http://jsfiddle.net/9brbD/19/
Also I would add a class to the span, instead of using span {} use myClass
{}.
|
How to align button to textarea corner and keep it in same relative position while expand contract |
Try removing the container's strict width, you can set a min-width instead
and if you make it display: inline-block or float: left you can make sure
it doesn't span the entire width of its parent.
http://jsfiddle.net/2uwDT/2/
.descriptionarea {
min-width: 490px;
position: relative;
display: inline-block;
}
|
When Zoomed the canvas and then pan, now if I am trying to drag the objects within canvas then not able to do so. But canvas is panning only |
If I understand correctly you must change coordinates and widthheight of
image on your scale
You want to do something like this - http://drag.com.hostinghood.com/?
|
canvas button onmouseover change color |
In this fiddle you have click() and onmousemove() that are working.
I didn't understand well if you want to display button at the beginning or
just when the mouse hovers somewhere on the future place of the button but
it's a beginning :
http://jsfiddle.net/Akinaru/3a7g2/57/
Main modification :
canvas.onmousedown = nonGameContent.getMouseClick;
canvas.onmousemove = nonGameContent.getMouseOver;
|
How to align a button bottom with multiline edit text in linear layout Android |
you have to use the relative layout as parent of your Linerlayout
See the example here..
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<EditText
android:id="@+id/edittextid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Your edit text"
android:maxLines="3" />
<Button
android:id="@+id/buttonid"
android:layout_width="match_parent"
|
Drawing multiple Shapes on the same Canvas when pressed a button |
Suggestions:
The factory should not create a GUI, should not extend Canvas, or really
extend anything, it should not create a JFrame or do anything of the sort.
It should concern itself only with creating objects of Shape child classes.
The GUI creation code should be elsewhere.
Likely the factory's getFigure(...) method will be the one to produce this.
It should likely accept a parameter, perhaps a String or an enum, that
tells it what sub-class of Shape to produce.
Shape's draw method should likely accept a Graphics parameter so that its
children can use it to draw with.
You shouldn't mix AWT components (i.e., Canvas) and Swing components
together unnecessarily. Instead, just draw in a JPanel's
paintComponent(Graphics g) method, not in a Canvas's paint(Graphics g)
method.
In that JPane
|
Make button visible on new path drawn on Canvas |
You get the NullPointerException because the button references are null in
the onTouchEvent() method. This is happening because you look for the
buttons with findViewById() directly which will look for the buttons only
in the custom view and its children. So, instead of:
btnS = (Button) findViewById(R.id.shareButton);
btnSa = (Button) findViewById(R.id.saveButton);
look for the button in the Activity(the Context parameter passed in the
constructor) containing the buttons and the custom view:
btnS = (Button)((Activity) context).findViewById(R.id.shareButton);
btnSa = (Button)((Activity) context).findViewById(R.id.saveButton);.
|
How to apply back button to canvas in windows phone? |
You can detect and cancel the navigation with the back button by overriding
the OnBackKeyPress method and setting e.Cancel to true.
From there, it's just a matter of detecting whether the canvas is
displayed.
protected override void OnBackKeyPress(CancelEventArgs e)
{
if (EHeightCanvas.Visibility == System.Windows.Visibility.Visible)
{
e.Cancel = true;
EHeightCanvas.Visibility = System.Windows.Visibility.Collapsed;
}
}
|
View canvas after click button - App Force close |
The method signature of the Pattern method is incorrect.
When used as android:onClick in the XML it must be public void Pattern(View
view)
You need to figure out another approach for what you are trying to do, when
you click the button you do not have paint access to the canvas of the
view.
|
Trigger a mouse click upon an input type button from canvas |
If you are using the onclick event, you would need something like this:
Edit: so you have a rectangular area in your canvas that should be clicked?
if so, you define the 4 limits leftLimit, rightLimit, topLimit and
bottomLimit, and execute this function onclick:
var canvas = document.getElementById('yourCanvasId');
button = document.getElementById('yourButtonId');
canvas.onclick = function(event) {
event = event || window.event;
var x = event.pageX - canvas.offsetLeft,
y = event.pageY - canvas.offsetTop;
if(x > leftLimit && x < rightLimit && y > topLimit
&& y < bottomLimit) {
var e = document.createEvent("MouseEvents");
e.initMouseEvent("click",1,1,document.defaultView,0,0,0,0,0,0,0,0,0,0,button);
button.dispatchEvent(e);
}
}
|
using fabric.js ,increase fontSize of canvas text on button click |
Here is a working code,
var canvas = window._canvas = new fabric.Canvas('c');
var text = new fabric.Text('Sample', {
left: 100,
top: 100,
fontSize:80,
fill: 'navy'
});
canvas.add(text);
document.getElementById('btn').addEventListener('click', function (e) {
canvas.getActiveObject().set("fontSize", "30");
canvas.renderAll();
});
|
Cocos2D - HTML5, button stops working after scaling canvas |
This is a known bug with touches not being scaled appropriately. You can
download a patched CCTouchDispatcher from here until it is fixed in the
next release hopefully: http://www.cocos2d-x.org/boards/19/topics/31205
|
Bootstrap - Align grid col to vertical-align on the middle and to the left |
The solution i found was create a form with a form-group and put a label to
the buttons.
<div class="col-lg-12">
<form class="form-inline" role="form">
<div class="form-group">
<label>Para Receber: </label>
<button type="button" class="btn btn-warning
btn-sm">Hoje</button>
<button type="button" class="btn btn-warning btn-sm">Na
Semana</button>
<button type="button" class="btn btn-warning btn-sm">No
Mês</button>
<button type="button" class="btn btn-danger btn-sm">Somente
Atrasados</button>
</div>
</form>
</div><!-- /.col-lg-12 -->
|
How can I get facing html elements to left-align and right-align, respectively, preferably using CSS? |
You are using display: inline-block; which will make the element inline, it
is no more a block level element, hence there is no space for the text to
align to the left or to the right.
Just wrap the elements inside a div and than float the element to the
right.
Demo
Also am using
.wrap {
overflow: hidden; /* This will clear floats */
}
For a better clearfix, you can also use the below snippet and call the
class on parent element.
.clear:after {
clear: both;
display: table;
content: "";
}
You can also assign width to the .wrap here, so that elements stay inside
boundaries.
|
.align directive proper usage with .align(5) and 0x90 |
It's a power-of-2 alignment, e.g., ALIGN(4) for 16-byte alignment, ALIGN(5)
for 32-byte, etc. The 0x90 specifies the opcode for the NOP instruction -
to be used as the padding instructions to achieve the alignment.
There are longer instructions sequences that are also effective NOPs. Many
of the assemblers support the more flexible .p2align directive; all recent
GNU-based assemblers for example.
|
Programatically align radio button to center in radio group |
With the help on TerrilThomas i was able to solve the issue:
Here is the solution :
RadioImageButton.setButtonDrawable(icon); // Not proper way
do not pass the icon inside the button instead pass it on the compund
drawable method if any of the radiobutton it will do good.
RadioImageButton.setCompoundDrawablesWithIntrinsicBounds(left, top, right,
bottom)// use this to set the icon
Thanks to TerrilThomas , cheers
|