Found 2041 Articles for Mobile Development

How to get the Navigation Bar height in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

3K+ Views

A navigation bar appears at the top of an app screen. To read more about ithttps://developer.apple.com/designhttps://developer.apple.com/documentationGetting height of Navigation bar becomes important if you’ve multiple view controllers having different UI and requirement. It becomes hectic if you’re not aware how to get the height of the same or modify as per need. Let’s see how we can get the height of Navigation bar.import UIKit class ViewController: UIViewController {    override func viewDidLoad() {       super.viewDidLoad()       let navBarHeight = UIApplication.shared.statusBarFrame.size.height +          (navigationController?.navigationBar.frame.height ?? 0.0)       print(navBarHeight)    } }

How to make the corners of a button round in iOS?

Sharon Christine
Updated on 30-Jul-2019 22:30:26

1K+ Views

You might come across a scenarios where you received a UI where the buttons are rounded, and you might wonder how to do that? So here we will see how to make corners of a button round.We will be seeing both the ways to make the button rounded, one using Storyboard and another programmatically.Let’s get started! First we will make the corners of button rounded using Storyboard.Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “RoundedButton”Step 2 − Open Main.storyboard and add a button as show belowStep 3 − Now select the button ... Read More

Disable Scroll View Programmatically in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

975 Views

Scroll View is one of the most difficult and complicated topic an iOS Developer come across. Here we will be seeing how to disable Scroll View Programmatically.For disabling the same we need to make the “isScrollEnabled” property of our scroll view to false.Copy the below code in your file.import UIKit class ViewController: UIViewController {    @IBOutlet var scrollView: UIScrollView!    override func viewDidLoad() {       super.viewDidLoad()       scrollView.isScrollEnabled = false    }    override func didReceiveMemoryWarning() {       super.didReceiveMemoryWarning()       // Dispose of any resources that can be recreated.    } }

Change Color of Button in iOS when Clicked

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

1K+ Views

Imagine you’re playing a song and as soon as you press the stop button, the color of the button should turn to red. This is one of the many scenario where you might need to change the color of button when it is clicked.In this tutorial we will see how to change the background color of a button when it is clicked. So let’s get started!Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “ChangeButtonColor”Step 2 − In the Main.storyboard create one button and name it stop.Step 3 − Create @IBAction of the ... Read More

How to disable action bar permanently in Android?

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

422 Views

This example demonstrate about How to disable action bar permanently 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.java     Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add the ... Read More

How to make a background 25% transparent on Android?

George John
Updated on 30-Jul-2019 22:30:26

208 Views

This example demonstrate about How to make a background 25% transparent 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.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add the following code ... Read More

How to use AutoCompleteTextView in Android App?

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

137 Views

This example demonstrate about How to use AutoCompleteTextView in 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.java     Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.support.v7.widget.AppCompatAutoCompleteTextView ; import android.widget.ArrayAdapter ; public class MainActivity extends AppCompatActivity {    private String[] fruits = { "Apple" , "Banana" , "Cherry" , "Date" , "Grape" , "Kiwi" , "Mango" , "Pear" } ;   ... Read More

How to set margins in an Android LinearLayout programmatically?

Chandu yadav
Updated on 30-Jul-2019 22:30:26

4K+ Views

This example demonstrate about How to set margins in an Android LinearLayout programmatically.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.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.widget.Button ; import android.widget.LinearLayout ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;       ... Read More

How do I get the resource id of an image if I know its name in Android?

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

2K+ Views

This example demonstrate about How do I get the resource id of an image if I know its name in AndroidStep 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.java         Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; import android.util.Log ; import android.widget.TextView ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       ... Read More

How to add manifest permission to an application in Android?

George John
Updated on 30-Jul-2019 22:30:26

495 Views

This example demonstrate about How to add manifest permission to an application 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.java Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.os.Bundle ; import android.support.v7.app.AppCompatActivity ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add the following ... Read More

Advertisements