color page's dot in a Titanium.UI.Scrollableview - titanium

Is it possible to use a custom color or image for the white dot of the pagingControl in a Titanium.UI.Scrollableview?
var scrollableView =Titanium.UI.createScrollableView({
views:[view1,view2,view3],
showPagingControl:true,
pagingControlHeight:30,
pagingControlColor:'transparent',
width : 200,
height : 90,
left : 120,
top:40,
maxZoomScale:2.0,
currentPage:0
});

Answer (as you said) found on http://developer.appcelerator.com/question/130397/color-pages-dot-in-a-titaniumuiscrollableview#227004 :
sorry, i dont have an example.. but here is it:
create a container view.
then create the small "dot" views, and add them to the container view. set the positions.
there is an event, when the scrollable view "scrolls" or changing.. and you can set the small dot view to active (of course you should set up the active state as well)

Related

Appcelerator: How to create Ti.UI.TextArea dynamically adjusting to content but with minimal height

I want to create a Ti.UI.TextArea object which would dynamically adjust its height to content but would have default height set (if no content). In Appcelerator if you don't specify height then it will automatically adjust its size to content but if there is no text then its size will be similar to textField. This is to small for me.
If you specify height property, then TextArea height won't change even if text will be longer than editable region.
I would like to have something like this:
var textArea = Ti.UI.createTextArea({
minHeight: 30,
});
or like this:
var textArea = Ti.UI.createTextArea({
minLines: 3,
});
I am looking for solution both for Android and iOS.
Is there any workaround for that?
You can change the height of the textField dynamically.
Add onChange event handler and change the height of the textField dynamically according to the number of lines in the text field.
Starting with 7.5.0.GA you can use maxLines on Android to be able to extend the TextArea to when pressing return. For iOS you have to create a work-around since there is no parity at the moment.

margin of customMediaItem in jsqmessageviewcontroller

i have a class that extend: JSQLoadingPhotoMediaItem, all works fine expected that in my chat i do not use image for bubble, but i have a background color and radius for textView inside the bubble, if i use the class i obtain this:
The first one is the textView of the cell with a color background, the second one is a view that i return from class with this code:
view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 38))
view!.backgroundColor = UIColor(red:0.89, green:0.98, blue:0.78, alpha:1)
view!.layer.cornerRadius = CGFloat(9)
view!.layer.masksToBounds = true
in a function
override func mediaView() -> UIView!
How can i give the same right margin to my custom class? or if for example would like to have a view of custom class aligned center?
Thanks!
I also had the same problem. To get the same margin for my bubbles I resorted to using the same JSQMessagesMediaViewBubbleImageMasker from JSQMessagesMediaViewBubbleImageMasker.h in my custom media view
//apply mask to your view
[JSQMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:view isOutgoing:self.appliesMediaViewMaskAsOutgoing];
You can create a category of JSQMessagesMediaViewBubbleImageMasker and extend it however you wish, there was a particular case where I needed a specific color for the border of the bubble.
Thanks! i found a solutions, i have a clear background for the main view, and inside another subview with right or left margin based on sender, backgroundColor and corner radius!

How to resize ext.net container with border layout on browser window resize

Below is the markup i am using to render an EXT.NET container containing a collapsible panel(west) and another panel containing my content (center).
how do i make it resizable when i resize my browser?
currently its not resizing as i specified width and height and if i do not specify Width and Height, it does not show me anything, it shows blank.
#Html.X().Container().Layout(LayoutType.Border).Width(500).Height(300).Items(
Html.X().Panel()
.ID("Panel1")
.Region(Region.West)
.AutoDoLayout(true)
.Collapsible(true).Border(true).Title("West Panel").Items(
Html.X().Label().Text("Item 1"),
Html.X().Label().Text("Item 2")
),
Html.X().Panel().ID("Panel2").Region(Region.Center).Title("Center")
)
EDIT : I Cannot use ViewPort as its distracting my layout
I am not ure container support this but viewport.
Use instead of the container an viewport
#Html.X().Viewport().Layout(LayoutType.Border).Items(
Html.X().Panel()
.ID("Panel1")
.Region(Region.West)
.AutoDoLayout(true)
.Collapsible(true).Border(true).Title("West Panel").Items(
Html.X().Label().Text("Item 1"),
Html.X().Label().Text("Item 2")
),
Html.X().Panel().ID("Panel2").Region(Region.Center).Title("Center")
)
another solution I can imagine ,to get the resize event and set the width and height of container with the appropriate values

Avoid auto resize of a View when keyboard is showed

I have a Cross-Platform app.
I use percentages to keep the aspect of the app similar for every screen size.
So i put a view height to
var view = Titanium.UI.createView({
borderRadius:10,
backgroundColor:'red',
height:"100%",
});
window.add(view);
The problem come when i show the keyboard.
The view is auto resized.
So i need that the keyboard goes OVER the view without resize it.
Note: If i use "dp"/"dpi" the height of the view is not the same in different screen devices.
Any suggestion?
I did not have this problem before, but there are several options having the same effect as 100% height:
height: Ti.UI.FILL
height: Ti.Platform.displayCaps.platformHeight
or you could achieve the same by setting the values for
left: 0, right: 0, top: 0, bottom: 0,
All of them should make a view fill the screen.
Please note that it might be necessary to handle orientation changes.
first you need to set top property then if it does not work then also set height with platformHeight.
It's not clear what your complete view looks like. Your example doesn't have a text entry type control which is what would trigger the keyboard opening.
You can create a separate view that contains the textArea and set this 2nd view with fixed positions. Then the main view should stay put.

How to put UILabel.textColor in Interface Builder

I would like to put the font to my UILabel, i do it like this : myLabel.textColor = [UIColor colorWithRed:242.0/255 green:239.0/255 blue:236.0/255 alpha:1.0f]; My question is : how i can do exactly the same think with Interface Builder ? i know that i will use the inspector color in IB, but i don't know how to put the same think, for example how to put : red:242.0/255 in IB, and the alpha :1.0f ? thanks for your answers
place a label in IB,
go to Attribute Inspector -> Text Color-> Other
In colors window, Go to Color Sliders (2nd tab on top)
Click on Grey Scale Slider and change it to RGB Sliders.
There you can put R/G/B values as you have done in code.
You dont need to put like: x/255
just set Red as : 242
Alpha can be set between 0 - 1 with Opacity slider at the bottom 0 - 100.