2016-05-03 9 views
0

現在、すべての写真をページに読み込むことができますが、すべての写真はアプリケーションの中心に重ねて表示されます。私はそれが属しているデータの前に画像を表示したい。テキストフィールドのデータ内の写真を整理するにはどうすればいいですか?

[フォト]

名:

性別:

年齢:

[フォト]

名:

例えば

セックス:

年齢:

...

これは現在、私のコード(XMLのURLからロードされたデータ)であり、私はrectおよびその他のプロパティを確認しようとしましたが、私はできませんでした運がある。

repeat for each line tChild in tChildren 
    add 1 to x 
    put revXMLChildNames(tInfo, "ArrayOfXmlNode/"&tChild&backslash, return, "adoptableSearch", true) into tAdoptable 

    put revXMLNodeContents(tInfo, "ArrayOfXmlNode/"&tChild&"/"&tAdoptable&"/Photo") into tURL 
    put url tUrl into tPhoto 
    if the result is empty then 
    set the text of img x to tPhoto 
    else 
    beep 
    end if 

    put "Name: " & revXMLNodeContents(tInfo, "ArrayOfXmlNode/"&tChild&"/"&tAdoptable&"/Name") & return after tData 
    ... 
end repeat 

ありがとうございました!

答えて

0

コードにイメージを作成していないので、繰り返しループの前にイメージを作成したと仮定します。イメージのサイズと位置をロックする必要があります。

私の他の提案は、画像と1つ以上のフィールド(名前、性別、年齢など)を持つテンプレートグループを作成することです。その後、各パーツに素敵なレイアウトを作成することができます。完了したら、グループ内のすべてをロックできますが、完全なグループの場所は簡単に設定できます。最後に、テンプレートグループをカードの外に移動するか、非表示にすることができます。

put 50 into tTop 
put 20 into tLeft 
put the width of group "templateGroup" into tTempGW 
put the height of group "templateGroup" into tTempGH 
put 0 into tCount 
repeat for each line tChild in tChildren 
    copy group "templateGroup" to this card 
    put it into tGroupID   # It holds the long id after a copy operation 
    put url tUrl into tPhoto 
    if the result is empty then 
    set the text of img 1 of tGroupID to tPhoto 
    else 
    beep 
    end if 
    # Position the new group 
    set the topLeft of tGroupID to tLeft,tTop 
    add tTempGW to tLeft 
    if tLeft + tTempGW > the width of this stack then 
    # Next item will be partly outside so we move down 
    add tTempGH to tTop 
    put 20 into tLeft 
    end if 
    # Set some proper name 
    add 1 to tCount 
    set the name of tGroupID to ("Person" && tCount) 
    put revXMLNodeContents(tInfo, "ArrayOfXmlNode/"&tChild&"/"&tAdoptable&"/Name") into field "name" of tGroupID 
    ... 
end repeat 

もちろん、他の値を使用することもできます。私は通常、空のグループを使用して他のすべてのグループを保持し、そのグループの境界を上、左、右として使用します。

関連する問題