1

You can see rows in picture.

those are rows

This is code of that view:

<div layout="row" layout-align="space-around center" >
<product-image-thumbnail layout="row" layout-align="left center"
    src="vm.callFunction(field)"
    setter="vm.callFunction(value)" />

<md-button  ng-click="vm.onMouseOver(field.getSrc))" layout="row" layout-align="right center">
    <md-icon>zoom_in</md-icon>
</md-button>
</div>

I want to align image or uploadanimage to left, zoom button to right.

But it doesnot work.

i also tried

layout-align="start start
 layout-align="end end"

but it did not do the job.

Also i tried buttons to convert to column but it is same.

it makes two rows if i dont put first layout. i need them inside a row.

this is where src image comes

<div ng-show="!vm.src" layout="row">
    <md-button class="md-button md-ink-ripple" ng-click="vm.Dialog($event)">
        <md-icon>file_upload</md-icon>
        <span translate>upload_image</span>
    </md-button>
</div>
<div ng-show="vm.src" class="thumbnail" layout="column" layout-align="center center" flex layout-padding ng-click="vm.Dialog($event)">
    <img src="{{vm.src}}" style="max-height: 60px;max-width: 60px"
         error-src="content/images/no_image_icon.gif"
    />
</div>
3
  • 1
    You have (second row) ...layout-align="left center". May be worth trying only ...layout-align="left". Commented Nov 13, 2016 at 14:55
  • I just tried, i wish it worked but did not :( Commented Nov 13, 2016 at 14:58
  • 1
    what is product-image? directive? Commented Nov 13, 2016 at 15:00

4 Answers 4

1

<p>This is some text. <img src="smiley.gif" alt="Smiley face" width="42" height="42" align="left"> This is some text.</p>

Sign up to request clarification or add additional context in comments.

Comments

1

If you want to use angular material, try using the space-between param. Example Plunker.

<div><!-- shouldn't need layout here-->
    <img layout="row" layout-align="space-between center"  />
    <button layout="row" layout-align="space-between center">Zoom</button>
</div>

1 Comment

it makes two rows if i dont put first layout. i need them inside a row.
1

You can try this way,

<section layout="row" layout-align="end center" layout-wrap>
    <div layout="row" layout-align="start center" flex>
      <img src="https://echtemaaltijd.blob.core.windows.net/image/image_671ed3d3-0c1e-43d5-9e9a-86247556fd00" class="md-card-image" alt="Washed Out">
      <span flex></span>
    </div>
    <md-button class="md-warn">Type</md-button>
  </section>

DEMO

Comments

1

Try this with flex!

<div layout="row" layout-alignment="stretch">
    <product-image-thumbnail flex
        src="vm.callFunction(field)"
        setter="vm.callFunction(value)" />

    <md-button  ng-click="vm.onMouseOver(field.getSrc))" flex="5">
        <md-icon>zoom_in</md-icon>
    </md-button>
</div>

The flex Will take up as much space as it can till 95% of the available width and flex=5 will ensure it is 5$

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.