react-native-image-marker icon indicating copy to clipboard operation
react-native-image-marker copied to clipboard

Multiline: textAlign?

Open marksturm opened this issue 6 years ago • 3 comments

Is there a chance to reach textAlign center on Multilines?

marksturm avatar Nov 22 '19 16:11 marksturm

Ok, if i change it to ALIGN_CENTER it works :) on Android.

So basicly looking for such a solution for iOS

https://github.com/JimmyDaddy/react-native-image-marker/blob/master/android/src/main/java/com/jimmydaddy/imagemarker/ImageMarkerManager.java#L364

marksturm avatar Nov 22 '19 17:11 marksturm

Have you found the solution for text aligning ? Found this solution https://stackoverflow.com/questions/6801856/nsattributedstring-add-text-alignment NSMutableParagraphStyle *paragraphStyle = NSMutableParagraphStyle.new; paragraphStyle.alignment = NSTextAlignmentRight; NSDictionary *attr = @{ NSFontAttributeName: font, //设置字体 NSForegroundColorAttributeName : color, //设置字体颜色 NSShadowAttributeName : shadow, NSParagraphStyleAttributeName:paragraphStyle };

yestay90 avatar Jul 30 '20 22:07 yestay90

Now margin only to fill textBackground in Android. We need to be margin horizontally supported.Just like:

int marginHorizontal = 20; if (position == null && null != X ) { marginHorizontal = X; } // ALIGN_CENTER, ALIGN_NORMAL, ALIGN_OPPOSITE StaticLayout textLayout = new StaticLayout(mark, textPaint, canvas.getWidth() - 2 * marginHorizontal, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);

Hope ASAP to support

JenusDong avatar Jan 14 '21 03:01 JenusDong