center

How to remove unwanted spaces at the right of CheckBox?

时光怂恿深爱的人放手 提交于 2019-12-04 00:23:38
I am working on a custom list view. I want to show a CheckBox at the custom view. There is no text for the CheckBox . I found it always have some spaces at the right of the CheckBox . Here is my layout xml file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="#fa9654" android:paddingTop="65dp" android:paddingBottom="65dp"> <TextView android:id="@+id/bus_route_list_item_num" android:layout_height="wrap

Android Button Place Image in center and text at bottom

有些话、适合烂在心里 提交于 2019-12-03 23:57:32
I want to place Image in the center and text just below it in a button, I tried to set android:gravity but could not set it properly,here is the image attached: below is my xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingLeft="10.0dip" android:paddingTop="10.0dip" android:paddingRight="10.0dip" android:paddingBottom="10.0dip" android:background="@drawable/background_img" > <LinearLayout android:layout_height=

how to center an inline div using css?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 23:23:38
问题 How can I center an inline div (not its content) using css? VERY IMPORTANT: the width of the div is unknown (I can not specify it) 回答1: If by inline you mean, its CSS display property is set to inline then you can center it by giving the immediate parent container a text-align:center If you mean a div within another div, you can follow this approach if you can add a wrapper and float both: How to horizontally center a floating element of a variable width? 回答2: I solved this. You should add

How to zoom to the center with a scrollview?

霸气de小男生 提交于 2019-12-03 22:17:30
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, since we're no longer using the gesture recognizer we're going to have to figure out what cgpoint to pass

Element “align” is obsolete or non-standard: what should I use instead?

天大地大妈咪最大 提交于 2019-12-03 22:12:19
I have this HTML code: <td align="center"> and I'm getting this error in Visual Studio 2008 from ReSharper: "Element ' align ' is obsolete or nonstandard" What is the replacement of this code to make it standard? You should use text-align in CSS rather than using the obsolete html styling attributes. td{ text-align:center; } That would be something like: <td style="text-align: center;"> But it would be even better to move that style out of the html and put it in a separate style-sheet. You did not explain your goal, but using CSS is more modern... <td style="text-align: center;"> Using that

How do You Center a TextView in Layout?

 ̄綄美尐妖づ 提交于 2019-12-03 22:09:56
I have a complex layout, part of which features a value centered over a label, with + and - buttons on either side of the value. I want the value to center between the buttons, whether it is "1" or "99". It looks fine when it's a 2-digit number like "99", but when it's a single digit the number is left-justified. How do I properly center that value? Here's the portion of my layout that does this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/runway_label" android:layout

Setting of ImageView's gravity to the center in android programmatically

杀马特。学长 韩版系。学妹 提交于 2019-12-03 22:03:12
I want to set the gravity of an array of Imageviews,ImageIcons[i] to the center with the following code, ImageIcons[i] = new ImageView(this); ImageIcons[i].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); layout.addView(ImageIcons[i]); And I am stuck up while setting the gravity.I request the SO people to guide me on this. Thanks Try this LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(width, height); layoutParams.gravity=Gravity.CENTER; ImageIcons[i].setLayoutParams(layoutParams); get the layout parameters from view, modify it and

Center image vertically and horizontally inside of DIV with float:left?

蓝咒 提交于 2019-12-03 20:16:00
问题 I need a working solution to do a trival task of centering images with different dimensions, to a square div when float:left is used to place images in rows.I use div inside of div to do the trick : .outer-element{ //wrap tile div display:table-cell; width:300px;height:300px; text-align:center ; vertical-align:middle ; float:left; margin-bottom:15px; } .inner-element{ //div with image inside display:inline-block; } BUT I must use use float: left for outer-element to put images into rows and

ios Title and Subtitle in Navigation Bar centered

穿精又带淫゛_ 提交于 2019-12-03 16:05:17
I'm trying to have two UILabels in my navigation bar instead of just one. I followed this link to have informations on how to do that: iPhone Title and Subtitle in Navigation Bar It works well, but I can't get my texts to be centered properly. It is centered between the buttons, but the default title behaviour is to center itself right under the time. I had a look here, same question, but no answer: UINavigationBar TitleView with subtitle What am I missing? Here is my code: CGRect headerTitleSubtitleFrame = CGRectMake(0, 0, 200, 44); UIView* _headerTitleSubtitleView = [[UILabel alloc]

How do I center floated list items?

試著忘記壹切 提交于 2019-12-03 13:34:06
I have list items for my site nav that I need to center. I'm floating so that I can have padding on the list items...setting them to inline seems to eliminate top and bottom padding. <style type="text/css"> #nav { width:100%; } #nav ul { margin-right: auto; margin-left: auto; } #nav ul li { float: left; background-color: #333; color: #fff; padding: 15px; margin: 10px; } </style> <div id='nav'> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul> </div> By making the items display inline you can then align them as text. Setting the line height fixed wrapping issue. #nav{