flutter change bottomNavigationBar(TabBar) height - dart

I just found a way to change the height of AppBar with PreferredSize().
But I still not found a way modify the height of BottomNavigationBar and TabBar. Such widgets all hard coded, is there a way can change the widget height for thinner BottomBar and TabBar.

_BottomNavigationBarState class is private, and in it's build method there is string BoxConstraints(minHeight: kBottomNavigationBarHeight + additionalBottomPadding). There is no way to change this height without customization this class

Related

How to get the height for the system navigation bar?

I'm trying to get the height of the system navigation bar so that I can calculate the height of other widgets accordingly.
I was able to get the height of the screen. Is there a way to get the usable height?
usable_height = total_height-(status_bar_height +
navigation_bat_height)
I'm using this method to get the total screen size:
double getScreenHeight(BuildContext context) {
return MediaQuery.of(context).size.height;
}
If your Widgets need to know the size available to them then you can wrap them in LayoutBuilder which will have the width and height available to you Widget
Watch official sample here:
https://www.youtube.com/watch?v=IYDVcriKjsw
Some examples:
How can I layout widgets based on the size of the parent?
https://flutterwidgets.io/widget-of-the-week-layoutbuilder.html
But if want to know the AppBar height then AppBar height in Flutter

Wrap content of UILabel inside a row cell in swift

Being an android developer, when I want the width and the height of something to wrap its content I simply change the width and height value in the inspector to "wrap content" and it's done. it does not seem as simple as that in Xcode. What I'm trying to achieve is the design of a messaging app, i.e.:
As you see each row has it own height and width of the UILabel according to the text size.
I tried to look for solutions using auto layout and stuff but with no success!
I was able to have dynamic height but the width of the UILabel is always stretched when used and I'm kinda lost. any straightforward solution in order to achieve this or a hint on how to use the auto layout to get the desired results ? Thank you.
labelName.sizeToFit()will change the frame of the label to fit the text

Wrapping text in UITextView in Swift

UPDATE: Looks like the UITextView's width is bigger than screen's width.
It is strange since I created the UITextView using a storyboard and in preview mode it looks like it's width is less than that of the UIViewController.
I have a UITextView, in a UIViewController, that was created using storyboard.
I have similar code to populate the text in the UITextView.
self.taskGroupDescriptionTextView.text = taskGroup.description
self.taskGroupDescriptionTextView.textContainer.lineBreakMode = NSLineBreakMode.ByCharWrapping
I tried different types of lineBreakMode, break by char/word. None of them work.
My UIViewController when run on iOS simulator still has text that extends beyond the screen.
You should set constraints. Here's an example how to do it:
You click on your UITextView so that you can start editing it. At the bottom of the storyboard there are few icons and clicking on the one shown in the image will open up an editor where you can add constraints. You have plenty of options (pin to left, right, top, bottom, fix height or width, aspect ratio,... and even more if you click on a neighbour icon). Keep in mind that you have to set enough constraint so that it will be reasonable for your view controller to calculate the frame size of your view. But no worries, if you'll forget something you'll get an error.

Jumping issue when changing the custom keyboard height

I am able to change the custom keyboard height but when i am changing the keyboard height first it setting to default keyboard height and jumping back to the given height.
please help me out in this.
Per the docs: "In iOS 8.0, you can adjust a custom keyboard’s height any time after its primary view initially draws on screen." It is impossible to solve the jumping issue.
You need to change the height in the viewWillAppear of your keyboard (the one you are inheriting from UIInputViewController).

iOS 8 Today Interface Builder

I've programatically set the width and height of my Today widget, and those changes are reflected when I run my app on my phone. However in my storyboard, the height has not changed (so I can't really position objects properly).
How can I set the view size in IB? It doesn't let me change the width/height at the moment.
EDIT: This post is about how to set up the layout it in storyboard, not how to code the widget which I can do.
Select the view in IB, click the ruler icon (Size inspector?), then there's a height field that you can change to whatever you want

Resources