Dynamic chat bubble using autolayout - autolayout

I am developing an application like iMessage.I would like to UI same like iMessage chat bubble work. I developed table view cell with auto layout.I have below table cell with UIImageView and UILabel.
UIImageView contain bubble image with resizableImageWithCapInsets. Right now everything is working fine except if text is small string then chat bubble is showing throughout the screen. so I would like to set constraints in such a way that my image view width will be according to label text. So if Label text is small then it will be small width image So it will be resizable according to width of label text. Any idea?
Current output:
.

I was thinking about my problem and researching on it and found below solutions. Posting it if it helps other.
So make it dynamic width based on text I put another blank label on right hand side and add constraints with it relative to left hand side controls(image view and label). Below is my final layout of constraints. Then it's working as expected.
Output Screen shot :

Related

Freeze/float cell while keeping other cell scrollable

I am creating a table where I need to freeze some cell while keeping the other cell scrollable. The table must be responsive to screen size that is why I need to make some cell scrollable.
Based on the picture above, I want to keep the blue area floating/or freeze while the red area scrollable.
How is this possible in google app maker?
First of all, this widget that you refer to as a table in your sample screen is actually a composite widget where it combines several basic widgets like the list, horizontal panel, and pager.
There is another table widget under charts, called Table chart, that can be used to present your data in rows and columns. But if you are looking for a property that can achieve this UI effect, then I'm afraid AppMaker does not support this yet.
If you are really keen to make this work, I would suggest that you combine two table widgets that inherit the same data source then wrap them SIDE-BY-SIDE in a horizontal panel. The left side will only contain columns that you want to freeze while the right size will have the rest of the column that can be scrollable.
Make sure to set the height of both tables to auto-grow based on the content (Fit to content). This will give the effect that the two tables are merged when doing vertical scrolling.
I have here a sample implementation as I described above. I gave a background to the main container to better understand the concept. I also added a small gap to show that I used two table widgets.
Here is the set-up in editor view (screen-shot)
See it in action here (video)

Dynamic UI in Xamarin.Forms

I would like to add a scrollable menu to a mobile app page.Here Transfer, Accounts, Payment and Transaction are generated from an XML file.The rest is static layout.I am using Xamarin.Forms.I would like to know how to generate UI components dynamically and attach them to a placeholder using Xamarin.Forms.
Dynamic UI creation is simple like the people said and there are many examples. But i think the problem is creating your own control according to your needs. For example i ended up with writing my own button with image in it like this:
So you have to write a method that creates a vertical stack layout (lets say outer container),and add a horizontal container to that "outer container" (lets say inner container) than add an image and a label to this "inner container" and make "innerContainer.HorizontalOptions = LayoutOptions.Center" etc. If you want border it goes complicated :)
Vertical Stack (whole container)
->Vertical Stack (height 2px) upper border
->Horizontal Stack (to hold middle controls,left border,inner image and text holder, right border etc.)
->Horizontal Stack (width 2 px) left border
->Vertical Stack (layoutOptions=Fillandexpand)
->Image (layoutOptions=Center)
->Label (layoutOptions=Center)
->Horizontal Stack (width 2 px) right border
->Vertical Stack (height 2px) lower border
So you have to join the controls like this hierarcy. First think how can you draw your control with existing controls than code it :) Hope i made my self clear.
i think you can use "Collection View" which is new feature of xamarin.forms or "bindable layout" to make it dynamic.

Put UI image to Grid Layout Group Unity C#

I got trouble put the UI image inside Grid Layout Group in Unity.
This What happen. Check the link below.
[IMG] http://i65.tinypic.com/fp2dly.jpg [/IMG]
[IMG] http://i65.tinypic.com/2iudlxe.jpg [/IMG]
Whatever i have done change the Grid Layout Group Component : cell size value, spacing. It end with the same result like the url pic above with image gameobject cut at left side. The image gameobject size did not fix the content from the grid layout group.
When i try to scroll it, it end with same result.
Any idea ?
Thanks
I found the solution myself,
Read this :
http://docs.unity3d.com/ScriptReference/Transform.SetParent.html
example :
childx.transform.SetParent (parentx.gameObject.transform,false);
it solve the problem

Issues with using CKEDITOR built-in templates

I am trying to use the default templates available with CKEDITOR.So I choose the one where an image and text can be placed side by side i.e. the image is occupying a certain part of the editor and the text the remaining part(but on the same horizontal level.I hope you get my point).But when I paste an image into the image area(provided in the template) , the text automatically shifts itself towards the bottom of the image(i.e. now image and text are not on the same level anymore). This happens no matter whether the size of the area provided for the image is bigger or smaller than the image.
Can any one say why this is happening and how to solve it.
You can change the Image Alignment To get the text in the same horizontal level
Image Properties -> Image Info -> Alignment -> Left | Right

qt unexpandable layout?

Ok, here is my problem:
I have a vertical layout which contains a QPlainTextEdit and a horizontal layout (containing 2 QPushButtons) below the text edit.
The vertical layout is just a part of GUI, and gets resized depending on screen resolution. Btw. it is a mobile app, so I don't have a lot of space on screen.
Push buttons have some text which is dynamically set, I don't know it from the beginning to code it manually.
My problem occurs when the text in push buttons is big, and my whole vertical layout is expanded to fit the buttons.
How can I make the vertical layout unexpandable? note, that this is different from "fixed" because of different screen resoulutions.
I'd just like the clip the buttons if they do not fit, but keep the layout width untouched.
Anyway to do this?
You'll need to set the maximum width for the buttons, not the layout, which is only widening to fit the wider buttons. Check out the docs on QPushButton and look for QWidget inherited functions called setMaximumSize or setMaximumWidth.
You can always GetWidth() on the button when it is an appropriate size, then setMaximumWidth using that value since you wouldn't ordinarily know this. Pick an appropriate default text size/val and use that to create your "dynamic" default since this is going on screens of varying size.

Resources