Adjust row height by font size in PickerIOS#13513
Conversation
shergin
left a comment
There was a problem hiding this comment.
How do you choose 8 as a compound padding?
424c2ce to
58fdd38
Compare
|
@shergin I chose it by trial and error. This value made the view look the most natural. |
|
Okay, but... Default row height is |
58fdd38 to
9f19716
Compare
|
@shergin you're right, it makes sense. It actually looks way better with a 19 offset |
|
@alin23 I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
|
@alin23 I am sorry for the delay, should we still merge this? Have tried to test how this change affects default usage? |
There is a problem where setting a bigger fontSize in PickerItem style clips the top and bottom of the text. This solves that problem by computing the row height using the font size.
9f19716 to
b309410
Compare
|
@shergin Sorry for closing this, I just took for granted what the bot said and thought that the file was removed/refactored somehow. Yes, I still think this needs to be merged. I got a request from another react-native user to merge this into master so I guess it would be a good idea to do this. Default usage didn't seem to be affected or changed in any way in my previous tests. As long as I didn't change the default font size, everything looked the same. |
|
@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@alin23 why auto row height with font size? it is correct? If i use a few PickerIOS , fontSize is different, row height is catastrophic。 like this image |
|
@ldhios indeed, I didn't take into consideration that the columns could have different font sizes, thus breaking the alignment. It might not be correct, but it is better than clipping the text. |
|
@alin23 Thanks for you reply in time。 Can you help me fix my issues? |
|
@ldhios I'm sorry but I haven't developed in Obj-C or React Native in a while. A workaround would be to hide those separators by setting the |
|
@alin23 Thanks。 |


masterbranch, NOT a "stable" branch.Motivation (required)
There is a problem where setting a bigger fontSize in PickerItem style
clips the top and bottom of the text.
This solves that problem by computing the row height using the font
size.
Test Plan (required)
Create a PickerIOS component and set a larger font size (e.g. 50). The row height will grow accordingly.
Example with
fontSize=50: Screenshot