UILabel未正确更改文字

时间:2017-02-13 01:53:06

标签: swift xcode nsstring uilabel nsuserdefaults

每当我打印出Highscore或得分时,它就会完全打印出来。无论是7和7还是7和5。

当我拉起模拟器时,文本被更改为Hi ...或Sc ... 而不是高分:x或得分:c

$caseReg = new CaseRegister();
    $form = $this->createForm('Alarm\Component\Form\CaseRegisterType', $caseReg);
    $form->handleRequest($request);
    $citylist = $this->getDoctrine()->getRepository('AlarmComponent:OfficeArea')->findBy(array('pid'=>0,'status'=>0));
    $caseType = $this->getDoctrine()->getRepository('AlarmComponent:CaseType')->findBy(array('status'=>0));
    if ($form->isSubmitted()) {
        $em = $this->getDoctrine()->getManager();
        $param = $request->request->get('alarm_component_caseregister');
        if($param['receiveId'] == 0)
        {
            $case = new CaseType();
            $case->setCaseName($param['receiveName']);
            $em->persist($case);
            $em->flush($case);
            $caseReg->setReceiveId($case->getId());
            $caseReg->setReceiveName($case->getCaseName());
        }
        if($param['cityId'] != 0)
        {
            $city = $this->getDoctrine()->getRepository('AlarmComponent:OfficeArea')->find($param['cityId']);
            $caseReg->setCityId($city);
        }

        if($param['subofficeId'] != 0)
        {
            $suboffice = $this->getDoctrine()->getRepository('AlarmComponent:OfficeArea')->find($param['subofficeId']);
            $caseReg->setSubofficeId($suboffice);
        }
        $em->persist($caseReg);
        $em->flush($caseReg);
        return $this->redirectToRoute('case_register_index');
    }
    return $this->render('AlarmWebBundle:BackendBat\CaseRegister:new.html.twig', array(
        'caseReg'   =>  $caseReg,
        'form'      =>  $form->createView(),
        'citylist'  =>  $citylist,
        'casetype'  =>  $caseType
    ));

1 个答案:

答案 0 :(得分:1)

您需要将标签的宽度更改为大于当前值的值。