stretch

Maximum width and height for ImageView in Android

馋奶兔 提交于 2019-11-27 05:21:22
问题 So I have an ImageView set with android:maxHeight="100px" android:maxWidth="250px" android:minHeight="100px" android:minWidth="250px" android:scaleType="centerInside" This image view is used to show a picture that is obtained from the gallery or camera. In both cases, the image is not resized to fit inside the imageview, it just stretches its space as much as it needs. Any idea how to make it stay inside those bounds? <?xml version="1.0" encoding="utf-8"?> <EditText android:layout_height=

CSS Div stretch 100% page height

a 夏天 提交于 2019-11-27 02:35:37
I have a navigation bar on the left hand side of my page, and I want it to stretch to 100% of the page height. Not just the height of the viewport, but including the areas hidden until you scroll. I don't want to use javascript to accomplish this. Can it be done in HTML/CSS? Here is the solution I finally came up with when using a div as a container for a dynamic background. Remove the z-index for non-background uses. Remove left or right for a full height column. Remove top or bottom for a full width row. EDIT 1: CSS below has been edited because it did not show correctly in FF and Chrome.

HorizontalAlignment=Stretch, MaxWidth, and Left aligned at the same time?

纵然是瞬间 提交于 2019-11-26 19:16:24
问题 This seems like it should be easy but I'm stumped. In WPF, I'd like a TextBox that stretches to the width of it's parent, but only to a maximum width. The problem is that I want it to be left justified within its parent. To get it to stretch you have to use HorizontalAlignment="Stretch", but then the result is centered. I've experimented with HorizontalContentAlignment, but it doesn't seem to do anything. How do I get this blue text box to grow with the size of the window, have a maximum

GridView and excess space padding

浪子不回头ぞ 提交于 2019-11-26 16:55:05
问题 I have a problem with grid view layout on Android. I can't find solution to eliminate extra space in grid view. I tried a lot of things (numColumns, columnWidth, stretchMode, gravity) and advices (from StackOverflow), but nothing works correctly. I spent almost 8 hours with this problem. Here is a code of grid view: <GridView android:id="@+id/lookbook_gridview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:listSelector="@null" android:padding="0dip" android

iPhone image stretching (skew)

橙三吉。 提交于 2019-11-26 14:02:12
How do I skew an image? For example, each corner has a CGPoint with coords - p1, p2, p3, p4. Then, I need to set - p4.x+=50, p4.y+=30. So this corner (p4) should be stretched in a 2D perspective and the image should be distorted. (source: polar-b.com ) I tried to use CATransform3D , but it seems that this cannot be done in such way, since it's only a change the perspective of view (rotate, bring closer/farther one side). Maybe CGAffineTransform can be useful? If you know the answer, please write a sample code. Thanks in advance Not possible with CGAffineTransform. An affine transform can

How to Stretch WPF Tab Item Headers to Parent Control Width

孤街醉人 提交于 2019-11-26 10:28:47
问题 Is there a way in XAML to cause the tab item headers to stretch across the width of the tab control? For example, I have three tabs: red, blue and green. If I have a tab control with its width set to auto, the tab headers will only fill up part of the space above the tab content, but I want them to fill up all the space. For my three tab example, red should take up the first third of the control, blue should take up the center third, and green the final third. I have an idea how to do this in

CSS Div stretch 100% page height

北城余情 提交于 2019-11-26 10:06:56
问题 I have a navigation bar on the left hand side of my page, and I want it to stretch to 100% of the page height. Not just the height of the viewport, but including the areas hidden until you scroll. I don\'t want to use javascript to accomplish this. Can it be done in HTML/CSS? 回答1: Here is the solution I finally came up with when using a div as a container for a dynamic background. Remove the z-index for non-background uses. Remove left or right for a full height column. Remove top or bottom

iPhone image stretching (skew)

有些话、适合烂在心里 提交于 2019-11-26 05:55:04
问题 How do I skew an image? For example, each corner has a CGPoint with coords - p1, p2, p3, p4. Then, I need to set - p4.x+=50, p4.y+=30. So this corner (p4) should be stretched in a 2D perspective and the image should be distorted. (source: polar-b.com) I tried to use CATransform3D , but it seems that this cannot be done in such way, since it\'s only a change the perspective of view (rotate, bring closer/farther one side). Maybe CGAffineTransform can be useful? If you know the answer, please