center

How to zoom to the center with a scrollview?

廉价感情. 提交于 2019-12-05 09:03:53
问题 We had previously implemented tapping to zoom and now we've decided to use icons instead that will zoom in on the center of whats currently being displayed, and we'd like to reuse the code we had for our tap to zoom since we want the same effect, but now we don't know what to pass as the centerpoint. We're using the (CGRect)zoomRectForScale:(float)scale withCenter:(CGPoint)center method which used to accept a center cgpoint from the gesture recognizer that we used for tap zooming; however,

Force align a content in center

核能气质少年 提交于 2019-12-05 08:21:58
I have some content which will contain some divisions, labels, forms in it. I want to force them in the center of page. How can I do this? Note: I tried using <div align="center"> , <center> but nothing works? If your content doesn't have a fixed width do this: <div class="content"> <div class="inner">some content</div> </div> .content { text-align: center; } .inner { display:inline-block; } If it does, you could do this: .content { width: xpx; margin: 0 auto; } Done You must use margin (auto) to center the div but it must have a width. W3School - Center Aligning Using the margin Property <div

How to center on HTML5?

半城伤御伤魂 提交于 2019-12-05 06:32:44
So i have this code here Which is the plans i will be providing on my website, but i have commented out one of the plans and now im looking to just display 3 plans, so how would i center all 3 of them as you can see by the picture, there more to the left? <!-- Row fuid--> <div class="row"> <!-- Item table --> <div class="col-sm-6 col-md-4 col-lg-3"> <div class="item_table"> <div class="head_table"> <h1>FREE</h1> <h2>£ 0.00 <span>/ Mo</span></h2> </div> <ul> <li class="color">2 GB HDD</li> <li>25GB Bandwidth</li> <li class="color">1 E-mail Account</li> <li>1 Sub Domains</li> <li class="color"

How to add annotation on center of map view in iPhone?

守給你的承諾、 提交于 2019-12-05 04:50:26
I have MAP view in my app and i want to add Annotation pin (Red pin) on center of map view. Now when user scroll map view pin should adjust with center according to that. How to do that? Thank If you want to use an actual annotation instead of just a regular view positioned above the center of the map view, you can: use an annotation class with a settable coordinate property (pre-defined MKPointAnnotation class eg). This avoids having to remove and add the annotation when the center changes. create the annotation in viewDidLoad keep a reference to it in a property, say centerAnnotation update

Why are images centered vertically with `line-height` positioned 2 pixels below where they should be?

左心房为你撑大大i 提交于 2019-12-05 02:32:32
Short story: jsfiddle here . The behavior is consistently wrong in Chrome 21, Firefox 15 and IE9, which makes me think I'm misunderstanding something about the CSS spec. Longer story: I want to center an image vertically using line-height. I've set the height of the image container equal to the line-height, I've reset margins, paddings and borders for all elements, yet the image is 2 pixels below where it should be. This happens whether the image is smaller than the container, or larger than it (in which case I used max-width: 100; max-height: 100% to size it down). The image has an even

JavaScript zoom image and center viewable area

旧城冷巷雨未停 提交于 2019-12-05 02:27:18
问题 I'm trying to create a zoom able image upon click of a button, however the image should be zoomed centered on the view able area, as the image may be bigger than the container. I've created a fiddle here to illustrate what I want, I'd obviously usually hide the image outside the container, I'm not bothered about that part just now, also put in a border overlay to show the bounds of the container. I've done the zoom part based on the image ratio, I just need to work out the new top and left

css: how to build centered div with minimum spacing on the left

孤者浪人 提交于 2019-12-05 01:00:32
问题 so the past days i tried to achieve the following: the idea being to have a div (red) that is ultimately centered (using margin:auto;), and on the same level (x-axis) another div that has a fixed size (blue). on a huge enough display, maximized, it looks great. now the fun part is when having a smaller screen and/or resizing the window. because of the auto margin, one of the divs overlaps the other: this is what i want to prevent. (in explanation: red being the menu, blue being the logo) so

How to align properly center the social footer and footer menu?

梦想的初衷 提交于 2019-12-04 20:44:36
How to align properly center the social footer and footer menu? I tried to align the social footer in three lines, in the 1st line is the icons and the 2nd and 3rd lines are the text at the bottom. But when I re-size the screen the icons are misbehave. While the footer menu, I want to displayed on one line only. I want to remain the design of footer to all mobile devices no matter what screen size they are. Here's the link: http://mobiletest.me/google_nexus_6/2507045 and jsfiddle Here's the CSS for media queries .hcsocialslitwitter, .hcsocialslifb, .hcsocialslilinked, .hcsocialslics,

Android TabHost Center active Tab

两盒软妹~` 提交于 2019-12-04 17:13:27
Is it possible to change Android Tabs that if you press one, it comes to the center of the TabHost. Only 3 Tabs are visible, doesn't matter how many there are. Like in the Android 4.0 Google Music App! If it is, how would you do that? Thank you! I did find the answer myself. If somebody else needs it, this should do it: final HorizontalScrollView mHorizontalScrollView; float scale = getResources().getDisplayMetrics().density; final double tabWidth = (int) (150 * scale + 0.5f); for (int i = 0; i < tabHost.getTabWidget().getTabCount(); i++) { tabHost.getTabWidget().getChildTabViewAt(i)

Is there a way to offset a view from center?

爷,独闯天下 提交于 2019-12-04 15:32:25
问题 I'm trying to possition my button not exactly in center, but let's say in the 2/5s of the screen height, I was looking for attribute unsuccessfully, so I tried this approach <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" android:padding="20dp" > <ImageButton android:id="@+id/flashlight_button" android