question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] Chinese and English can not be centered?

See original GitHub issue

Why chinese and english can not be centered. Here is an example: elements:

          <View style={styles.header_info_sub}>
                  <Text style={styles.header_info_sub_time}>刚刚</Text>
                  <Text style={styles.header_info_sub_from}>来自 aaa.com</Text>
          </View>

styles:

  header_info_sub: {
    flex: 0,
    flexDirection: 'row',
    alignItems: 'center',
  },
  header_info_sub_time: {
    fontSize: 12.0,
    color: 'orange',
  },
  header_info_sub_from: {
    fontSize: 12.0,
    marginLeft: 4.0,
    color: 'gray',
  },

effect: 109da5ac-aafe-4603-81e7-b0bdfaf4dc36

I must add paddingBottom: 1, to header_info_sub_from style to fix it. Why it can not be centered automatically?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pannzcommented, Feb 24, 2017

that is the because of the font use the default system font, Chinese character and English character even the Number are not in same alignment so when they in same line and same <Text /> components, the render result will not be centered!

You should find the FONT that the two kind of character render the same alignment

0reactions
mkonicekcommented, Oct 27, 2016

Hi there! This issue is being closed because it has been inactive for a while.

But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/ios-chinese-and-english-can-not-be-centered

Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top

Also, if this issue is a bug, please consider sending a pull request with a fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Game Center wrong language - Apple Support Communities
I can't find any settings that are specific to Game Center languages since all my regional settings are British/English. Any ideas?
Read more >
How to keep Chinese Character and Number Align Center in ...
The Problem is Number "629340.0" and Chinese character "元" can't keep align center. Number is higher than Chinese char.
Read more >
My iphone 5's language in settings is set in english but it types ...
Tap to choose the next language on your keyboard. The chosen language appears on the Space bar. Touch and hold to display a...
Read more >
[iOS]Chinese Mix English recognization – Help Center - ABBYY
I tried the OCR mobile engine. So far the result is not as good as I expected. I have attached an ID card...
Read more >
Type in a different language - iPhone & iPad - Gboard Help
Switch between languages · On your iPhone or iPad, open any app that you can type with, like Gmail or Keep. · Tap...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found