如何将多个png文件添加到同一个弹出框?

时间:2019-07-19 19:24:23

标签: python-3.x

我能够将一个png文件应用于大叶草标记,但是我希望显示多个图形。

此代码使我可以将一个png文件添加到大叶弹出框。带有#号的行是另一种版本,我尝试在同一个大叶草标记中绘制两个png文件,但无效。

onSelectedIndexChanged(args: SelectedIndexChangedEventData) {
    const fromIndex = args.oldIndex;
    const toIndex = args.newIndex;
    const tabView = <TabView>args.object;
    const tabIOS: UITabBarController = tabView.ios;

    const tabViewControllers: Array<UIViewController> = Array.from(tabIOS.viewControllers);
    const fromView: UIView = tabViewControllers[fromIndex].view;
    const toView: UIView = tabViewControllers[toIndex].view;

    tabIOS.setViewControllersAnimated(tabIOS.viewControllers, true);
    fromView.addSubview(toView);

    let screenWidth = UIScreen.mainScreen.bounds.size.width;
    let scrollRight = toIndex > fromIndex;
    let offset = (scrollRight ? screenWidth : -screenWidth);
    toView.center = new CGPoint({
      x: fromView.center.x + offset,
      y: toView.center.y
    });


    UIView.animateWithDurationAnimationsCompletion(0.6, () => {
      const fromCenter: CGPoint = new CGPoint({
        x: fromView.center.x - offset,
        y: fromView.center.y
      });

      const toCenter: CGPoint = new CGPoint({
        x: toView.center.x - offset,
        y: toView.center.y
      });
      fromView.center = fromCenter;
      toView.center = toCenter;

    }, () => {
      fromView.removeFromSuperview();
      tabIOS.selectedIndex = toIndex;
    })
  }

我得到了一个带有一个图形(文件)的叶标记。但是,我希望它在同一标记(文件,文件1)上显示两个数字。

0 个答案:

没有答案