I use Swipeable tabs and find that its height can scroll and I do not know where to change its height to be auto. Instead, I just want to remove it.
<SwipeableViews index={this.state.slideIndex} onChangeIndex={this.handleChange}>
<div style={tabsStyles.height}>
<h2 style={tabsStyles.headline}>Tabs with sadsada dasda</h2>
Swipe to see the next slide.<br />
</div>
</SwipeableViews>
Related
I'm trying to give my app a full-sized background. But I don't really know where to put it because wherever I put the image the navbar hasn't the background.
So I tried to surround my ion-content and my ion-footer with a <div> and hoped to give it the background-class. but in this case nothing I can't see anything on the screen. Right now my background is only inside the ion-content and the footer is still empty. How can I change it?
My code:
<ion-content class="bg-image" padding>
</ion-content>
<ion-footer>
<ion-toolbar>
</ion-toolbar>
</ion-footer>
Just like you can see in the docs, you need to add the fullscreen property to the ion-content:
<ion-content fullscreen="true">
<!-- ... -->
</ion-content>
If true, the content will scroll behind the headers and footers. This
effect can easily be seen by setting the toolbar to transparent.
I am using Material-Ui Appbar however when I scroll down the page the appbar goes underneath the address bar on iOS 10. And the address bar also stays open rather than collapsing. I am using the default material UI theme.
I dont assume it is supposed to work this way. Is there an example of how to do this correctly?
Ideally it would be great if the AppBar was fixed to the top of the page.
Thanks.
It's actually working as designed. If you want it to be fixed to the top of the page, you need to set CSS position to "fixed". This sticks the AppBar at the top, as desired, but since it is floating there it can obscure its own height's worth of content beneath it. So, you should compensate for that with some padding or margin (56px by default). Example using padding on outer container:
<div style={{ paddingTop: 56 }}>
<AppBar style={{ position: 'fixed', top: 0 }} />
<p>
Lots of tall/long content here...
</p>
</div>
Working jsFiddle: https://jsfiddle.net/qe141fd2/1/
I experience an issue with nested views in my Ionic app. I have a custom tab
navigation which is placed within my parent ion-view. The tab navigation is intended to scroll together with the content, which is located in an ion-nav-view underneath. For that I put the scroll="false" onto the child's ion-content.
The problem is, that my content won't expand the parent's height to fit the content's height. It has a height of 100%, which is fixed to the view's initial height. So at the end of the page there is content left, which is never displayed. Here is the template code (I am sorry, I cannot provide a plunkr example):
<ion-view>
<ion-content on-swipe-left="tabs.goToNext()" on-swipe-right="tabs.goToPrevious()">
<div class="tabbed-slidebox">
<div class="tsb-icons">
<div class="tsb-ic-wrp" style="">
Was
Wer
Wo
Wann
</div>
</div>
</div>
<ion-nav-view name="stepContent">
<!-- For illustration I copied ion-view from the template which will be rendered into this ion-nav-view -->
<ion-view view-title="Schadenmeldung">
<ion-content class="step step-what padding" scroll="false">
<!-- CONTENT -->
</ion-content>
</ion-view>
</ion-nav-view>
</ion-content>
<div class="fab-sticky">
<!-- some sticky button here -->
</div>
</ion-view>
See a demo here
My view hierarchy looks somehow like this:
app view (mainly ion-nav-bar)
tabs view (mainly tab navigation)
content view (content intended to expand the ion-view's height)
(I can provide the state config if that helps)
I already played around with the CSS a lot. But since I am no CSS Mastermind, I did not find a solution.
The problem seems to come from the position: absolute of the ion-nav-view. It prevents the height to
adapt to the content.
Can anyone help?
you can add style into ion-nav-view
for example:
<ion-nav-view name="stepContent" style="height: 380px"></ion-nav-view>
When scrolling a view with a textarea, the text area changes height while scrolling. After scrolling the original height is restored. This happens both in the Chrome device emulator and on iOS/Safari. See video for example:
https://www.youtube.com/watch?v=iMYaScyFL74
This example is based on the tabs example application
<ion-content class="padding">
<div class="list">
<label class="item item-input">
<textarea rows="10" placeholder="Write something then scroll the view while the textarea is focued"></textarea>
</label>
</div>
</ion-content>
Note that you have to enable the device emulator in Chrome to reproduce the problem. You can find the full source here:
http://codepen.io/moberg/pen/myyYMJ
Anyone knows how to make the textarea preserve its size while scrolling?
This is a known issue: https://github.com/driftyco/ionic/issues/1934
A fix seems to be ready to be merged atm: https://github.com/driftyco/ionic/pull/3007
I have a Autocomplete textbox which is inside a div with scrolling enabled. I add lots of textboxes dynamically inside the div which enables the vertical scrolling. When I scroll down and type in the auto suggest textbox then it appears waay above the correct location. How can I fix this?
Wrap your autocompleted textbox with a relative positioned div.
<div style="position:relative;">
<asp:TextBox runat="server" ID="myTextBox" Width="300" autocomplete="off" />
</div>