ReactTextTest.java 文件源码

java
阅读 91 收藏 0 点赞 0 评论 0

项目:RNLearn_Project1 作者:
@Test
public void testItalicFontApplied() {
  UIManagerModule uiManager = getUIManagerModule();

  ReactRootView rootView = createText(
      uiManager,
      JavaOnlyMap.of(ViewProps.FONT_STYLE, "italic"),
      JavaOnlyMap.of(ReactTextShadowNode.PROP_TEXT, "test text"));

  CustomStyleSpan customStyleSpan =
      getSingleSpan((TextView) rootView.getChildAt(0), CustomStyleSpan.class);
  assertThat(customStyleSpan.getStyle() & Typeface.ITALIC).isNotZero();
  assertThat(customStyleSpan.getWeight() & Typeface.BOLD).isZero();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号