Modify the Behavior of the Flex Wrap Property with CSS

Smita Kapse
Updated on 03-Jul-2020 10:35:13

245 Views

Use the align-content property to modify the behavior of the flex-wrap property.ExampleYou can try to run the following code to implement the flex-wrap property −Live Demo                    .mycontainer {             display: flex;             background-color: orange;             align-content: space-between;             height: 150px;             width: 600px;             flex-wrap: wrap;          }          .mycontainer > div {             background-color: white;             text-align: center;             line-height: 40px;             font-size: 25px;             width: 100px;             margin: 5px;          }                     Quiz                Q1          Q2          Q3          Q4          Q5          Q6          Q7          Q8          

Create a Disabled Look of a Button with CSS

Nitya Raut
Updated on 03-Jul-2020 10:24:23

405 Views

To create a disabled button look, use the CSS opacity property.ExampleYou can try to run the following code to create a disabled look of a button −Live Demo                    .btn1 {             color: black;             text-align: center;             font-size: 15px;          }          .btn2 {             color: black;             text-align: center;             font-size: 15px;             opacity: 0.5;          }                     Result       Click below for result:       Enabled       Disabled    

CSS grid-template-rows Property

Nancy Den
Updated on 03-Jul-2020 10:20:26

81 Views

The grid-template-rows property is used to set the number of rows in the Grid.ExampleYou can try to run the following code to implement the grid-template-rows property −Live Demo                    .container {             display: grid;             background-color: blue;             grid-template-rows: 70px 190px;             padding: 20px;             grid-gap: 20px;          }          .container > div {             background-color: orange;             border: 2px solid gray;             padding: 35px;             font-size: 30px;             text-align: center;          }                     Game Board                1          2          3          4          5          6          

Play YouTube Video in Android Application

Azhar
Updated on 03-Jul-2020 10:15:17

2K+ Views

This example demonstrates how do I play Youtube video in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 – Add following the dependancies in the build.gradle (Module:app)implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:cardview-v7:28.0.0'Step 3 − Add the following code to res/layout/activity_main.xml.         Step 4 – Create a layout resource file (Video_view.xml) and add the following code − Step 5 – Create a java class youTubeVideos.java and the following code −public class youTubeVideos {    String videoUrl;    public youTubeVideos() ... Read More

Create Text-to-Speech in an Android App

Azhar
Updated on 03-Jul-2020 10:14:44

227 Views

This example demonstrates how do I create TextToSpeech in an android app.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                         Step 3 − Add the following code to src/MainActivity.javaimport android.speech.tts.TextToSpeech; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; import java.util.Locale; public class MainActivity extends AppCompatActivity {    private TextToSpeech textToSpeech;    private EditText editText;    private ... Read More

Switch Between Different Activities in Android

Azhar
Updated on 03-Jul-2020 10:14:05

4K+ Views

This example demonstrates how do I switch between different activities in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         Step 3 − Add the following code to src/MainActivity.javaimport android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity {    Button button;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       button = findViewById(R.id.btnOpenAct2);       ... Read More

Send Data Back to Main Activity in Android

Azhar
Updated on 03-Jul-2020 10:12:13

960 Views

This example demonstrates how do I send data back to the main activity in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                 Step 3 − Add the following code to src/MainActivity.javaimport android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    private TextView textViewResult;    private EditText editTextNumber1;    private EditText editTextNumber2;   ... Read More

Change TextView Style at Runtime in Android

Azhar
Updated on 03-Jul-2020 10:11:17

932 Views

This example demonstrates how do I change a textView style in runtime in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     Step 3 – Add the following code in res/values/styles.xml    bold|italic    #FFFFFF    normal    #C0C0C0

Determine the Size of an Android View at Run Time

Azhar
Updated on 03-Jul-2020 09:06:06

228 Views

This example demonstrates how do I determine the size of an android view at run time.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         Step 3 – Copy and paste an image (.png/.jpg/.jpeg) into res/drawableStep 4 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.ViewTreeObserver; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    ImageView imageView;    @Override    protected void onCreate(Bundle savedInstanceState) { ... Read More

Rotate an Image in ImageView by an Angle on Android

Azhar
Updated on 03-Jul-2020 09:05:03

1K+ Views

This example demonstrates how do I rotate an image in ImageView by an angle on android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class MainActivity extends AppCompatActivity {    ImageView imageView;    Button btnRotate;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);   ... Read More

Advertisements