swift - Create design chat with picture like whatsapp in IOS xamarin -
how create design chatting whatsapp (ios xamarin). in picture below:
my code:
contentview.addconstraints(nslayoutconstraint.fromvisualformat("h:|[bubble]", 0,"bubble", bubbleimageview)); contentview.addconstraints(nslayoutconstraint.fromvisualformat("v:|-2-[bubble]-2-|",0,"bubble", bubbleimageview )); bubbleimageview.addconstraints(nslayoutconstraint.fromvisualformat("h:[bubble(>=48)]",0,"bubble", bubbleimageview)); //setting layout image picture var vspacetopattch = nslayoutconstraint.create(imgpicture, nslayoutattribute.top, nslayoutrelation.equal, bubbleimageview, nslayoutattribute.top, 1, 10); contentview.addconstraint(vspacetopattch); //setting layout message label var vspacetop = nslayoutconstraint.create(messagelabel, nslayoutattribute.top, nslayoutrelation.equal, bubbleimageview, nslayoutattribute.top, 1, 10); contentview.addconstraint(vspacetop); var vspacebottom = nslayoutconstraint.create(messagelabel, nslayoutattribute.bottom, nslayoutrelation.equal, bubbleimageview, nslayoutattribute.bottom, 1, -10); contentview.addconstraint(vspacebottom); var msgleading = nslayoutconstraint.create(messagelabel, nslayoutattribute.leading, nslayoutrelation.greaterthanorequal, bubbleimageview, nslayoutattribute.leading, 1, 16); contentview.addconstraint(msgleading); var msgcenter = nslayoutconstraint.create(messagelabel, nslayoutattribute.centerx, nslayoutrelation.equal, bubbleimageview, nslayoutattribute.centerx, 1, 3); contentview.addconstraint(msgcenter);
result code:
position image behind bubbleimageview. how design layout whatsapp in ios xamarin?
have tried bringing subview image front with:
contentview.bringsubviewtofront(yourimagesubview);
?
Comments
Post a Comment