I have one window it's layout is vertical,i have added two child views for that window ,those views height will dynamically change.After adding the views to window,First view is not fit to it's contents some gap is coming.Please help me how to solve this.
below is my code
<Alloy>
<NavigationWindow id="profBidPostNav" platform="ios">
<Window id="profBidPostWin" layout="vertical">
<View id="MainView" height="Ti.UI.SIZE"></View>
<View id="customerServiceMainView" height="Ti.UI.SIZE" top="0%"></View>
</Window>
</NavigationWindow>
Can you add a screenshot to see the problem ?
I see two errors on your code, hieght instead of height and top="0%". If your Window have vertical layout, no need to add top property.
<Window id="profBidPostWin" layout="vertical">
<View id="MainView" height="Ti.UI.SIZE"></View>
<View id="customerServiceMainView" height="Ti.UI.SIZE"></View>
</Window>
Related
I have a problem on iOS with KeyboardAvoidingView that put the scrollview scrollbar on left or in the middle of the screen. The code is like following
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
style={{ flex: 1 }}
>
<ScrollView
style={{flex: 1}}
/>
</KeyboardAvoidingView>
I notive that embedding this code inside a SafeAreaView fix the problem (scrollbar on right) but visually I can't use it.
Does anyone encountered that strange behaviour ?
I am forced to use multiline={false} and set the height of TextInput in order to show it like it is a text area. Reason is that multiline={true} doesn't work very well with KeyboardAvoidingView (https://github.com/facebook/react-native/issues/16826).
So here is a simple code:
<TextInput placeholder="Input text here..." style={{height: 200}} multiline={false} />
and the output is: Screenshot
I just want to make it the text align at the top. Works properly with Android though
Set style property textAlignVertical to top on the TextInput
<TextInput ... multiline={true} textAlignVertical: 'top' />
I'm trying to use a ScrollView in my UWP project. The problem is that when I assign a fixed value to my ScrollView Height, it works perfectly fine. However, if I assign a percentage value to its Height, it simply doesn't work and nothing is shown on that page, only a white blank screen.
Here's an example of a fixed value that works:
<ScrollView Id="MainScroll" Style.Height="700">
<Modules.TimeLineList></Modules.TimeLineList>
</ScrollView>
But, the following doesn't work and shows a white blank screen:
<ScrollView Id="MainScroll" Style.Height="100%">
<Modules.TimeLineList></Modules.TimeLineList>
</ScrollView>
In addition, the Modules.TimeLineList in the above examples is a ListView defined in another file and it contains some normal ImageView and TextView elements.
Any help is much appreciated.
I suppose you have placed the ScrollView inside a Stack (Pages are Stacks too). When you place a ScrollView inside a Stack you can't set the percentage based height for it.
Vertical stacks' height is calculated based on the overall height of their content (In this case ScrollView). At the same time, ScrollView tries to find the height of its parent (Stack) to calculate it's height based on its height. And it will prevent both from having proper height.
If you read your output messages, you will probably find some errors or warnings about it.
You can fix it by using a fixed height either for ScrollView or Stack.
I moved from android to Swift. In android we could assign a drawable to the left or right of the text, we could do this in XML.
for example this XML for a textView with picture on the left:
<TextView
android:id="#+id/myTextView"
android:layout_width="match_parent"
android:text="This is test text view and it is showing"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/myImage" />
so the image "myImage.png" will be same as the picture below.
I wonder if there is something similar in swift for ios ?
In Xcode Interface Builder, you can't really do that with one item. The best solution is to create a textView and an imageView, then pin the two together with aligning and margins in auto layout.
I have stackPanel created in design (xmal) which has Auto height and width. Adding list of image controls dynamically in Code on Load to stackPanel. Now it works fine. But when i try to resize the window, though the stack panel gets resized due to auto, but not the image contrl.
How to bind the actualheight of stackpanel dynamically to image control height, (so when ever stakpanl height gets changed ,image control also should get changed !!).
thanks
Use a ViewBox
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Viewbox MaxWidth="500" MaxHeight="500" Name="vb1">
<Image Source="tulip_farm.jpg"/>
</Viewbox>
</StackPanel>
How to: Apply Stretch Properties to the Contents of a Viewbox
Or you could use binding as below:
<StackPanel x:Name="MyStackPanel">
<Image Source="C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg" Stretch="Uniform" Height="{Binding ElementName=MyStackPanel, Path=ActualHeight}"></Image>
</StackPanel>