Found 1966 Articles for Apps/Applications

How to create Picker programmatically from array in iOS?

Mohtashim M
Updated on 30-Aug-2019 11:38:47

2K+ Views

A picker view displays one or more wheels that the user manipulates to select items. Each wheel—known as a component—has a series of indexed rows representing the selectable items.UIPicker is one of the important components and almost used in most of the applications. You’ll see them mostly in form-based applications.You can read more about it here: https://developer.apple.com/documentation/uikit/uipickerviewIn this post, we will be seeing how to create UIPicker programmatically from and array and load array values into it.So let’s get started, Step 1 − Open Xcode and create a single view application and name it PickerSample.Step 2 − Open ViewController.swift, Since ... Read More

How to dismiss the Alert with click on outside of the alert in iOS?

Mohtashim M
Updated on 30-Aug-2019 11:32:18

2K+ Views

Understanding and implementing UIAlert can be tricky especially if you’re new to iOS Development, In this post, we will be seeing how we can dismiss the alert when the user taps outside the alert box.For this demo, we will be using UIAlert class, to configure alerts and action sheets with the message that you want to display and the actions from which to choose. After configuring the alert controller with the actions and style you want, present it using the present(_:animated: completion:) method. UIKit displays alerts and action sheets modally over your app's content.You can read more about it: https://developer.apple.com/documentation/uikit/uialertcontrollerSo ... Read More

How to convert an image to Base 64 string on Android?

Azhar
Updated on 03-Jul-2020 07:20:49

1K+ Views

This example demonstrates how do I convert an image to Base 64 string 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 – Copy paste an image in the res/drawable. Example: res/drawable/logo.pngStep 4 − Add the following code to src/MainActivity.javaimport android.annotation.SuppressLint; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Base64; import android.widget.TextView; import java.io.ByteArrayOutputStream; public class MainActivity extends AppCompatActivity {    TextView textView;    String string;    Bitmap ... Read More

How to change screen brightness programmatically in iOS?

Mohtashim M
Updated on 30-Aug-2019 11:28:09

987 Views

To change the brightness of the screen we have to use the brightness property of the screen, This property is only supported on the main screen. The value of this property should be a number between 0.0 and 1.0, inclusive.Brightness changes made by an app remain in effect until the device is locked, regardless of whether the app is closed. The system brightness (which the user can set in Settings or Control Center) is restored the next time the display is turned on.It’s an instance property, To implement this in your iOS Application (any application) add below line in viewDidLoad ... Read More

How can I change the text color of the Navigation Bar on iOS?

Mohtashim M
Updated on 30-Aug-2019 11:22:16

589 Views

Changing the text color of the navigation bar is tricky and easy at the same time, In this post, we will be seeing how one can change the text color of navigation bar in swift.So let’s get started, Embed your view controller in Navigation controller as shown below and name navigation item for that particular controller as a tutorial as shown, Now navigate to AppDelegate.swift and add below lines in didFinisheLaunchingWithOptions method.func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {    // Override point for customization after application launch.    let textColor = [NSAttributedString.Key.foregroundColor:UIColor.green]    UINavigationBar.appearance().titleTextAttributes = textColor ... Read More

How to parse HTML in android?

Azhar
Updated on 03-Jul-2020 07:15:35

2K+ Views

This example demonstrates how do I parse HTML 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 given dependency in the build.gradle (Module: app)implementation 'org.jsoup:jsoup:1.11.2'Step 4 − Add the following code to src/MainActivity.javaimport android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.TextView; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.io.IOException; public class MainActivity extends AppCompatActivity {    Button button;    TextView textView; ... Read More

How to set the color of a textView span in android?

Azhar
Updated on 03-Jul-2020 07:17:54

681 Views

This example demonstrates how do I set the color of a textView span 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.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    TextView textView;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);     ... Read More

How to create CollectionView Layout in an iOS App?

Mohtashim M
Updated on 03-Jul-2020 07:17:17

363 Views

CollectionView with TableView are two of many fundamental concept of iOS development, every developer should master both to be a good developer.In this post we will be focussing mainly on CollectionView, CollectionView is same as table view with some difference, Collection View supports both horizontal and vertical scrolling which looks like a grid. CollectionView in iOS is also referred to grid view in Android.To read more about it you can refer https://developer.apple.com/documentation/uikit/uicollectionviewAs you can see Collection View consists of Supplementary View and Cell, The collection view presents items onscreen using a cell, which is an instance of the UICollectionViewCell class ... Read More

How to get the dimensions of a view in iOS App?

Mohtashim M
Updated on 30-Aug-2019 11:07:57

830 Views

Getting dimensions of a view is easy, In this post, we will see how one can get the dimensions of a view in iOS.Let’s get started, Step 1 − Open Xcode and create a single view application and name it SampleView.Step 2 − Open Main.storyboard and add UIView as shown below, Step 3 − Create @IBOutlet of the view in ViewController.swift.@IBOutlet var sampleView: UIView!Step 4 − In viewDidLoad of ViewController.swift write the following code, print(sampleView.frame.size)Run the application to see the size.Complete codeimport UIKit class ViewController: UIViewController {    @IBOutlet var sampleView: UIView!    override func viewDidLoad() {       ... Read More

How to create a WebView in an iOS App using Swift?

Mohtashim M
Updated on 30-Aug-2019 11:02:01

6K+ Views

As an iOS developer, you will come across multiple scenarios where you have to display something in web, for that we use WebView.As per Apple, − It is an object that displays interactive web content, such as for an in-app browser.So in this post, we will be seeing how to create WebView and load the data in it.So let’s startStep 1 − Open Xcode and create a single view application and name it WebViewSample.Step 2 − Open ViewController.swift file and import the WebKit module. import WebKitStep 3 − Add a property of WebKit in ViewController.swift.var webView: WKWebView!Step 4 − Add ... Read More

Advertisements