2017-12-26 10 views
0

ラベルをイメージの上に配置する必要があります。この画像は、レイアウトが "垂直"のビューにあり、このLABELを画像の右上に絶対に置く必要があります。これどうやってするの?Appcelerator:レイアウトレイアウト垂直のラベルレイアウトコンポジット

マイコード:

index.htmlを

`<Alloy> 
     <View class="col col-2"> 
          <ImageView id="images" class="img-thumbnail" /> 
          <Label id="name"></Label> 
          <Label id="price"></Label> 
     </View> 
</Alloy> 
` 

    app.tss 

    ".col-2":{ 
     layout: 'vertical', 
     width: '49.25%', 
     height: Ti.UI.SIZE, 
    } 
    ".badge":{ 
    top:0, 
    right:0, 
    backgroundColor:'green', 
    color:'white', 
    layout:'composite' 
} 

合金。 チタンSDKA:7.0.0.GA

+0

あなたがやりたいことのサンプルスクリーンショットを表示できますか? –

答えて

1

あなたがその垂直レイアウトの他のビューと一緒に画像&上記の右上隅にラベルを表示したい場合は、あなたが別のビュー&ショーであなたの垂直レイアウトをラップすることができます右上の画像:

<Alloy> 
    <View width="49.25%" height="Ti.UI.SIZE"> 

     <!-- now use full width on this view --> 
     <View class="col col-2" width="Ti.UI.FILL"> 
      <ImageView id="images" class="img-thumbnail" /> 
      <Label id="name"></Label> 
      <Label id="price"></Label> 
     </View> 

     <Label text="Put your top-right label here" width="Ti.UI.SIZE" height="Ti.UI.SIZE" top="16" right="16" /> 
    </View> 
</Alloy> 
+0

Thx Prashant !! 私はそれをする前に、 – kurungele