center

android RadioButton button drawable gravity

余生长醉 提交于 2019-12-28 03:30:28
问题 I am generating RadioButtons dynamically with RadioButton radioButton=new RadioButton(context); LayoutParams layoutParams=new LayoutParams(radioWidth,radioHeight); layoutParams.gravity=Gravity.CENTER; radioButton.setLayoutParams(layoutParams); radioButton.setGravity(Gravity.CENTER); BitmapDrawable bitmap = ((BitmapDrawable)drawableResource); bitmap.setGravity(Gravity.CENTER); radioButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.itabs_radio)); radioButton.setButtonDrawable

How to horizontal & vertical center a div? [duplicate]

不羁的心 提交于 2019-12-28 02:12:07
问题 This question already has answers here : How to horizontally center a <div>? (103 answers) Center a DIV horizontally and vertically [duplicate] (7 answers) Closed 6 years ago . Here is the source code: <div id = "outer"> <div id="top"> .... </div> <div id="inner"> .... </div> <div id="bottom"> .... </div> </div> I would like to know How to make the div (id inner), horizontal & vertical center? I can horizontal center, but can't make a vertical center... Thank you. 回答1: If you know the

Center form submit buttons HTML / CSS

为君一笑 提交于 2019-12-28 01:52:28
问题 I'm having troubles centering my HTML form submit buttons in CSS. Right now I'm using: <input value="Search" title="Search" type="submit" id="btn_s"> <input value="I'm Feeling Lucky" title="I'm Feeling Lucky" name="lucky" type="submit" id="btn_i"> with this CSS content #btn_s{ width: 100px; margin-left: auto; margin-right: auto; } #btn_i { width: 125px; margin-left: auto; margin-right: auto; } And it's not doing anything. I know I'm probably doing something stupid wrong. How can I fix this?

Horizontally center images which overflows their container

蓝咒 提交于 2019-12-25 11:52:58
问题 I am trying to center some images (horizontally) which overflows their container divs. The containers (and images, for that matter) have a height of 160px and I want to keep them with that height, even at smaller screen-sizes - but still keep the image horizontally centered. I have tried margin: 0 auto; with no luck. I came across an half-solution where it was suggested to use text-align: center; on the container div along with margin: 0 -100%; on the image itself. However this solution seems

How to center an image within a flex item (cell)

心已入冬 提交于 2019-12-25 09:08:15
问题 I have a 3x3 flexbox with an icon and title in each item/cell. I am just trying to horizontally center the icon (svg image). I tried justify-content: center; but it doesn't seem to work. Can any tell me how to horizontally center an image within a flexbox item (or cell, as I am referring to it as)? Code below. HTML: <div class="grid"> <div class="cell"> <img src="images/cs_icon_01.svg"> <div class="service-title">Materials Handling, Warehousing & Storage Facility Management</div> </div> <div

How to make parent div width shrink to wrap exactly the child imgs?

空扰寡人 提交于 2019-12-25 08:31:31
问题 Jsfiddle here: http://jsfiddle.net/zxJbV/ <div class="container" style="border:1px solid black;text-align:left"> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src="" style="width:60px;height:60px;" /> <img src

How do I align text view to be in center (vertically) of two NumberPickers?

懵懂的女人 提交于 2019-12-25 06:38:36
问题 I would like to align a TextView containing ":" between two NumberPickers, I would also like it to be on top of the NumberPickers so that it is not 'pushing' the NumberPickers to the side. Currently this is my XML for the LinearLayout containing the NumberPickers and TextView: <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_below="@id/timer"> <NumberPicker android:id="@+id/numberPicker1" android

Android: How to center a component in a custom view in action bar?

醉酒当歌 提交于 2019-12-25 04:47:22
问题 I have a layout like this : <?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="50dp" > <TextView android:id="@+id/title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_toRightOf="@+id/backToScan" android:gravity="center" android:textAllCaps="true" android:textAppearance="?android:attr

Trying to align text with background image. If below a certain resolution the text to the left moves in. How can I fix this?

丶灬走出姿态 提交于 2019-12-25 04:29:27
问题 Here is the css code I am using: #wrapper{ position:relative; width:950px; margin-left:auto; margin-right:auto } #content { text-align: left; padding: 0px 25px 0px 25px; margin-left: auto; margin-right: auto; position: absolute; left: 50%; /*half of width of element*/ margin-left: -450px; height: auto; } And this is the site: http://projectstratos.com/31-01-11/ Please ignore the social icons and the height issues. To see what I mean make your browser smaller and bigger. The text moves to the

Centering inside a <div> element

99封情书 提交于 2019-12-24 19:27:25
问题 I know this question has been asked a million times and I've already used all those solutions in other websites I created and they worked just fine. However, in my latest situation, the usual answers are not working for me. This is the class that needs to have other elements centered inside it (ie. lists, tables): .container { position: relative; width: 80%; height: 90%; background-color: #282828; box-shadow: inset -6px -6px 6px -2px #1d1d1d; color: #FFF; border-radius: 0 10px 0 0; float: