Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Moving a view changes another one which is centered (Android, Ti 3.2.0)

$
0
0

my xml:

<Alloy>
    <Window>
        <ScrollView id="scrollview">
            <ImageView id="img_head"></ImageView>
 
            <!-- hats -->
            <View id="view_hat"></View>
 
            <!-- bottom buttons -->
            <ImageView id="img_div" class="img_div"></ImageView>
            <View id="btn_left"></View>
            <View id="btn_right"></View>
            <Button id="btn_close" class="btn_close"></Button>
        </ScrollView>
    </Window>
</Alloy>
tss:
"#view_hat":{touchEnabled:false,top:0,left:0,zIndex:16,backgroundColor:"transparent",width:0,height:0}
".btn_close":{visible:false,opacity:0,backgroundColor:"transparent", backgroundImage:"/images/btn_close.png",bottom:0,width:50,height:50}
".img_div":{visible:false,opacity:0,image:"/images/trenner.png",bottom:45,width:200,height:5}
"#img_head":{top:0,touchEnabled:false,left:0}
inside my code i set the left position of view_hat and img_head to:
var RIGHTGAP = 80;
$.view_hat.left = RIGHTGAP * 0.5;
$.img_head.left = RIGHTGAP * 0.5;
as soon as I do that the btn_close moves moves 40px to the right even I don't move it. It wasn't doing that in 3.1.x but with 3.2.0 it moves.

I would like to keep it at in the middle position. Do I need to calculate the mid-point and set it by hand now?

Fedora, Ti 3.2 GA, SDK 3.2, Android 4.4


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>