English 中文(简体)
纽顿案文没有垂直地集中在纽顿
原标题:button text not getting centered vertically in button

我正在创造安乐器,我有一个带习俗背景形象的纽州。 背景形象只是一个直观,但现在纽特文似乎并不以纵向为中心。 这里是我对纽芬兰的xml:

<Button 
android:id="@+id/save_to_list"
android:layout_below="@+id/info_pic"
android:text="SAVE TO LIST"
android:textColor="@android:color/white"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_width="260dp"
android:layout_height="35dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"></Button>

我在此阐述背景:

ImageView button_bg = (ImageView)findViewById(R.id.button_background);
savetolist_button.setBackgroundDrawable(button_bg.getDrawable());

是否有在纽特改变案文的立场?

最佳回答

<代码>android:layout_gravity界定了母体内的布局。 在座标内统一案文,例如:android:gravity

<Button 
    ...
    android:gravity="center"
    ...>
</Button>
问题回答

你的纽子太短,无法适当阅读案文。 增加布局,案文应集中。

你的案文有可能作为每封信的一部分而列入字句,这就是为什么你的文本被推向一个方向。 定下字号,以“瓦拉-毗连”,案文现在应正确集中。

我发现,最好在直截了当的情况下使用9个拼凑图像,而不是一种可推敲的图像。





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签