GithubHelp home page GithubHelp logo

Translucent Property. about react-native-navbar HOT 8 CLOSED

kureev avatar kureev commented on September 18, 2024
Translucent Property.

from react-native-navbar.

Comments (8)

Kureev avatar Kureev commented on September 18, 2024

hm, I'm wondering if it's something different than opacity? You can just pass style prop and specify opacity key there

from react-native-navbar.

Kureev avatar Kureev commented on September 18, 2024

For example now you're doing something like

renderScene: function(route, navigator) {
  var Component = route.component;
  var navBar = route.navigationBar;

  if (navBar) {
    navBar = React.addons.cloneWithProps(navBar, {
      navigator: navigator,
      route: route
    });
  }

  return (
    <View style={styles.navigator}>
      {navBar}
      <Component navigator={navigator} route={route} />
    </View>
  );
}

but you can change return a little bit to make it looks like this:

...
  return (
    <View style={styles.navigator}>
      <View style={{ opacity: 0.5, }}>
        {navBar}
      </View>
      <Component navigator={navigator} route={route} />
    </View>
  );

from react-native-navbar.

Kureev avatar Kureev commented on September 18, 2024

@piyushchauhan2011 so, was it helpful or you're asking about something else?

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on September 18, 2024

@Kureev Sorry for late reply.
It applies the opacity but I think translucent is different.

I tried with and without sidemenu. Translucent is when user can see the content during scrolling below the navbar like in screenshot of medium.

Medium

screen shot 2015-07-26 at 12 59 21 am

Without Sidemenu

screen shot 2015-07-26 at 12 56 06 am

With Sidemenu

screen shot 2015-07-26 at 12 56 43 am

// Navigation with Content View
var Docit = React.createClass({

  renderScene: function(route, navigator) {
    var Component = route.component;
    var navBar = route.navigationBar;

    if (navBar) {
      navBar = React.addons.cloneWithProps(navBar, {
        navigator: navigator,
        route: route
      });
    }

    var menu = <SideBar flux={flux} navigator={navigator}/>;

    return (
      <SideMenu menu={menu}>
      <View style={MainStyles.navigator}>
        <View style={{ opacity: 0.5, }}>
        {navBar}
        </View>
        <View style={MainStyles.container}>
        <Component menu={menu} navigator={navigator} route={route} flux={flux} {...route.passProps} />
        </View>
      </View>
      </SideMenu>
    );
  },

  render: function() {
    return (
      <Navigator
        style={MainStyles.navigator}
        renderScene={this.renderScene}
        initialRoute={{
          component: NavigationBarView,
          navigationBar: <NavigationBar title="Home"/>
        }}
        configureScene={() => {
          return Navigator.SceneConfigs.FadeAndroid;
        }}
      />
    );
  }
});

from react-native-navbar.

Kureev avatar Kureev commented on September 18, 2024

In your case you can fix it by adding backgroundColor property to MainStyles.navigator.

from react-native-navbar.

piyushchauhan2011 avatar piyushchauhan2011 commented on September 18, 2024

I tried it on navigator, it does solve the problem of side menu which was showing up earlier I couldn't get the medium like effect.

screen shot 2015-07-26 at 10 11 41 am

from react-native-navbar.

Kureev avatar Kureev commented on September 18, 2024

You can implement it by using backgroundStyle from 0.7.2 version. The only point is that you can't use it in "casual" way described in examples. If you use navbar as Navigator.navigationBar property, it'll allocate special place for it. As I understood from your screenshots, you need to embed it into your component property. Maybe I'm wrong, but give it a shot and let me know.

@brentvatne Maybe you have any thoughts?

from react-native-navbar.

Kureev avatar Kureev commented on September 18, 2024

Closed until new feedback

from react-native-navbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.