text-alignment

Force GtkLabel to clip its center-aligned text

落花浮王杯 提交于 2019-12-06 00:49:48
问题 I`ve got a GtkLabel whose text is to remain centered regardless of whether it is shorter or longer than the label. For example, a Win32 static control that has the SS_CENTER style flag set behaves like that: ┌===========================┐ │ Lorem ipsum dolor │ └===========================┘ — when the text is shorter than the control; ┌===========================┐ Lorem ipsum│dolor sit amet, consectetur│adipiscing └===========================┘ — when the text is longer than the control. N.B.:

Text Alignment issue when I set the custom font

我是研究僧i 提交于 2019-12-05 18:22:40
问题 When I set the custom font for the segmented control then it changes the vertical text alignment. I am using below code to set the font . // I dont think these lines are creating any issue but just wanted to paste all the code self.segmentType.layer.borderColor = navigationTintColor.CGColor; self.segmentType.layer.cornerRadius = 0.0; self.segmentType.layer.borderWidth = 1.5; // These are the lines that are changing the text alignment UIFont *font = [UIFont fontWithName:ftHelveticaNeueLTPro_Th

3.1.4 textAlignment is missing ( Android Studio)

我的未来我决定 提交于 2019-12-05 14:06:43
I have the new Version of Android Studio (3.1.4), but I can't find textAlignment. I've already searched in "View all Attributes". Do somebody now where I can find it. Thanks for answering! Here's how I resolved the problem (on Android Studio 3.3 - Build #AI-182.5107.16.33.5199772, built on December 25, 2018): In Android Studio, open build.gradle (Module: app) . Look for minSdkVersion Changing this to 17 (from 15) did the trick for me. I suggest you try the same, unless you really need it to be earlier. Android Studio will rebuild your project and you should now see the textAlignment attribute

How to display Arabic notations in left-to-right direction in QLineEdit/QLabel etc.?

痴心易碎 提交于 2019-12-05 04:32:22
问题 In Qt's implementation arabic notation is shown in right-to-left direction, thus any strings that contain arabic notations will be right-aligned. But what my application wants to do is showing all texts in left-to-right direction, whether it contains arabic notations or not. And all texts are left-aligned. An example is shown below: This is what I want to implement This is how QLineEdit displays texts containing arabic notations in its default way This is how QLabel does it EDIT: Paste the

Right align text in HTML input field

佐手、 提交于 2019-12-05 01:04:29
I have an HTML tag with a short maxlength but a long value attribute. I'd like the displayed text to show the end (right side) of the text, rather than the start (left side). <input maxlength=10 value="A really really really long entry goes in here"/> currently shows: "A really r" instead I'd like it to show: "es in here" Cheers, Ian Do you want the visible area to start from the right? you can use css and the following rule input {direction:rtl;} rtl means from right to left example: http://jsbin.com/ilejo4 PS: the value of maxlength in your html must be wrapped with quotes, also you have to

Horizontally center <p> within a div while keeping the text left-aligned

和自甴很熟 提交于 2019-12-04 18:49:21
问题 I have multiple divs with a fixed width containing <p> tags which contain various lengths of text. I want this text to remain left-aligned but if the text does not take up as much space as the div width, I would like to align this text centrally. I assume the best way of achieving this would be to horizontally center the <p> within the div while keeping the text left-aligned but I'm not sure how to do this. I have tried setting margin:0 auto; but the <p> always resizes to the width of the div

Trouble left-aligning UIButton title (iOS/Swift)

≯℡__Kan透↙ 提交于 2019-12-04 15:09:09
问题 I'm having a problem left-aligning a UIButton 's text. I also tried changing it to .Right but it still stays centered. I also tried aButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0) instead of aButton.titleLabel?.textAlignment = .Left but that doesn't change anything either. Is there an alternative way to programmatically change the alignment of a UIButton title's? allButtonViews = UIView(frame: CGRectMake(0, 44, 100, 100)) allButtonViews.backgroundColor =

How to center a two-line text in a TextView on Android?

一世执手 提交于 2019-12-04 14:55:04
问题 I want to let it looks like this: | two | | lines | Here is the current layout, not working at all. <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="two\nlines" android:layout_gravity="center_vertical" android:layout_centerInParent="true"/> </RelativeLayout> Any idea? Thanks! 回答1: If you just want to center it (I'm assuming

Generic right-align function

泄露秘密 提交于 2019-12-04 14:35:41
Now that I know how to right-align columns of numeric values in Emacs, I have two issues with this solution: it is hard to remember it is not flexible For instance, it doesn't work when some of the values in the first column contains a number. And unfortunately it inserts tabs. Now I use rectangle functions ( C-x r k ) quite a lot. That made me think: would it be possible to have a function that right-aligns all text in the selected rectangle? (defun right-justify-rectangle (start end) (interactive "r") (apply-on-rectangle (lambda (c0 c1) (move-to-column c1 t) (let ((start (- (point) (- c1 c0)

Making a table with printf in c++

孤街浪徒 提交于 2019-12-04 12:33:02
问题 I'm trying to make a table like this.... (Just without the dots I used to separate the each item) Weekly Payroll: Name.....................Title.......Gross......Tax......Net Ebenezer Scrooge Partner 250.00 ..62.25 .187.75 Bob Cratchit ..........Clerk ......15.00 ....2.00 ..13.00 This is what my code looks like for this part.... for (int count=0; count < numberOfEmployees; count++) { cout << "Employee: \n"; cout << "\t Name: "; cin.getline (employees[count].name, EMPLOYEESIZE); cout << "\t