2016-09-25 36 views
0

我在離子和im動態創建使用n-g重複爲答案框的一個小測驗。我曾經嘗試過幾個小時,但它可以在ipad上運行得很好,但在iPhone上反過來也可以。這裏是如何看我的手機上:離子和phonegap與框中的css

enter image description here

,並在這裏對我的iPad enter image description here

的所有IM試圖做的是有一個對象有一個答案因此,例如「在心情」和動態地創建與答案一致的框,以便在本例中[] [] [] [] [] [] ..]

我正在使用ng-repeat來做什麼我在我的例子中:

<form> 
<span ng-repeat="content in answerArr track by $index" class="single-input"><span style="margin-right:10px;"></span><!--this adds space --> 
<div class="testingg" style="width:50%;margin-right:auto;"> 
<div style="width:50%;margin-right:auto;margin-left:auto;"> 
<span class="single-input" ng-repeat="contentt in content track by $index"> 

<div class="row"style=""> 
      <span ng-if="$index < content.length"> 
       <div class="box single-number" style=""> 
        <input type="text" class="" focus maxlength="1"> 
       </div> 
      </span> 
      </div> 
</div> 
</span> 
</div> 
</span> 
</form> 

有沒有更好的方法來做到這一點,或者我錯過了明顯的東西?我嘗試實現排序居中的CSS的地方,如果字則重疊,它會轉到下一行..像下面他們使用

enter image description here

althought __,我使用一個盒子。誰能幫忙?

回答

0

那麼,你可以爲你的每一行設置特定的長度。並且使用答案的長度創建tho的子串,並將它們推入任何對象。就像你的排的長度是5,你的答案是「超過心情」。您必須創建3個子字符串 並將它們推入對象。現在實現一個嵌套的ng重複,首先與 該對象包含子字符串,然後在裏面,與子字符串本身 希望它會幫助你:)

+0

即時通訊即時做我有一個對象與3個對象裏面,每個與數組對於每個字母如[[o] [v] [e] [r],[t] [h] [e],[m] [o] [o] [d]] –