Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react-native-dropdown-picker

#go to the wesite and read the docs
Web_link: https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/
    
#sample: 
#installation
npm install react-native-dropdown-picker

const [facultyOpen, setFacultyOpen] = useState(false);
const [facultyValue, setFacultyValue] = useState('electrical');
const [faculty, setFaculty] = useState([
    { label: 'Electrical & Computer Engineering', value: 'electrical' },
    { label: 'Civil Engineering', value: 'civil' },
    { label: 'Mechanical Engineering', value: 'mechanical' },
]);
#after-return
#used tailwind for style. delete all tw`` part if you don't use tailwind css
<View style={[tw`mb-3 z-50`]}>
          <Text
            style={[
              tw`font-semibold text-purple-600 ml-1 mb-1`,
              { fontSize: 18 },
            ]}
          >
            Faculty
          </Text>
          <DropDownPicker
            open={facultyOpen}
            value={facultyValue}
            items={faculty}
            setValue={setFacultyValue}
            setItems={setFaculty}
            setOpen={setFacultyOpen}
            style={[tw`bg-gray-200 w-full px-4 py-3 border-0`]}
            containerStyle={[tw`border-0 bg-gray-200 rounded-lg`]}
            dropDownContainerStyle={[
              tw``,
              {
                backgroundColor: '#E5E7EB',
                borderRadius: 10,
                zIndex: 1,
                borderWidth: 0,
              },
            ]}
          />
        </View>
Comment

style dropdown react native picker

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
     <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
     <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
    </style>

    <!-- Item selected font. -->
    <style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
     <item name="android:fontFamily">casual</item>
    </style>

    <!-- Dropdown options font. -->
    <style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
      <item name="android:fontFamily">casual</item>
      <item name="android:padding">8dp</item>
    </style>
<resources>
Comment

PREVIOUS NEXT
Code Example
Javascript :: send data from a file to frontend nodejs 
Javascript :: vscode search shortcut 
Javascript :: mongodb create index json 
Javascript :: make field un updatable mongoose 
Javascript :: javascript check if key is keydown is charcter 
Javascript :: Javascript array of array loop 
Javascript :: show code in console very good 
Javascript :: javascript get multiple attributes 
Javascript :: dfs javascript 
Javascript :: Turn Module Into Non Module 
Javascript :: Saving dependencies in your node package.json syntax 
Javascript :: Using <template in Javascript to create a form 
Javascript :: Creating New Transaction Object for blockchain 
Javascript :: how to chaage background color of any element from java script 
Javascript :: underscore js 
Javascript :: Javascript Area When All Sides are Known 
Javascript :: array operations = map, filter, find, reduce, some, every, indexOf 
Javascript :: Declare Function To Be Used In Class 
Javascript :: python code to javascript converter 
Javascript :: on submit success jquery 
Javascript :: check token balance of an address in js 
Javascript :: javascript auto complete not working 
Javascript :: recursive function and json object 
Javascript :: how to properly make the navbar to be fixed to the top in react.jsx 
Javascript :: How to Check if an Item is in an Array in JavaScript Using Array.includes() Starting From a Specified Index 
Javascript :: var date = new Date(); 
Javascript :: timezone using javascript 
Javascript :: window location href 
Javascript :: multiple path names for a same component in react router v6 
Javascript :: javascript return multiple values 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =