English 中文(简体)
i Telephone, how do I Centre button. 标题 标签案文?
原标题:iPhone, how do I center button.titleLabel text?

我改变了我的一个州的案文,但我没有认识到案文是集中的。

它设在IB

我怎么把它集中起来呢?

最佳回答

它只是一个文字标签,这样就能够发挥作用(在你看来是德洛德,把我的布特顿作为伊贝托特人的财产)。

myButton.titleLabel.textAlignment = UITextAlignmentCenter;

然而,它应当成为核心——似乎奇怪的是,它就没有了。 你们是否做过别的事情?

问题回答

现在(iOS 6):

 myButton.titleLabel.textAlignment = NSTextAlignmentCenter;

更改<条码>

在SOS 9处,迅速:

myButton.titleLabel.textAlignment = NSTextAlignment.Center

在Interface Buildinger, 选择纽芬兰语和新闻出版商-1, 以便设立特性监察员。 在“Control”下审视属性底线。 你们会看到一些东西,即“社区”和“联系的县”。 Press the Itton for central行一致。





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

Iphone NSTimer Issue

Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Xcode open two editor windows with same file

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...

Forcing code signing refresh in Xcode

In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...

热门标签