Permalink
Browse files

adding absolute link to guides

  • Loading branch information...
asb3993 committed Mar 29, 2018
1 parent 507ab1b commit cc6defba64d85e2a24ee51f2bec5143214d95340
Showing with 63 additions and 63 deletions.
  1. +1 −1 Recipes/android/controls/imagebutton/create_an_imagebutton/README.md
  2. +1 −1 Recipes/android/controls/listview/README.md
  3. +2 −2 Recipes/android/controls/webview/call_csharp_from_javascript/README.md
  4. +4 −4 Recipes/android/networking/detect-network-connection/README.md
  5. +5 −5 Recipes/android/resources/general/load_large_bitmaps_efficiently/README.md
  6. +1 −1 Recipes/cross-platform/networking/download_progress/README.md
  7. +1 −1 Recipes/ios/content_controls/scroll_view/create_a_horizontal_scrolling_button_list/README.md
  8. +1 −1 Recipes/ios/general/projects/environment_checks/README.md
  9. +2 −2 Recipes/ios/input/accelerometer/use_coremotion_with_accelerometer/README.md
  10. +5 −5 Recipes/xamarin-forms/Controls/call-javascript/README.md
  11. +1 −1 Recipes/xamarin-forms/Controls/choose-keyboard-for-entry/README.md
  12. +6 −6 Recipes/xamarin-forms/Controls/display-pdf/README.md
  13. +1 −1 Recipes/xamarin-forms/Controls/multiselect/README.md
  14. +1 −1 Recipes/xamarin-forms/Controls/rotation/README.md
  15. +3 −3 Recipes/xamarin-forms/Controls/screen-orientation/README.md
  16. +1 −1 Recipes/xamarin-forms/Maps/Geocode/README.md
  17. +1 −1 Recipes/xamarin-forms/Maps/map-navigation/README.md
  18. +1 −1 Recipes/xamarin-forms/Maps/reverse-geocode/README.md
  19. +1 −1 Recipes/xamarin-forms/iOS/add-done-to-keyboard/README.md
  20. +8 −8 Recipes/xamarin-forms/iOS/core-spotlight-search/README.md
  21. +2 −2 Recipes/xamarin-forms/iOS/ipad-listview/README.md
  22. +12 −12 Recipes/xamarin-forms/iOS/nsuseractivity-search/README.md
  23. +2 −2 Recipes/xamarin-forms/iOS/prevent-keyboard-suggestions/README.md
@@ -11,7 +11,7 @@ dateupdated: 2017-07-17
# Recipe
The [`ImageButton`](/api/type/Android.Widget.ImageButton/) will display button with an image. The image can be a PNG or, under certain circumstances, an SVG resource.
The [`ImageButton`](https://developer.xamarin.com/api/type/Android.Widget.ImageButton/) will display button with an image. The image can be a PNG or, under certain circumstances, an SVG resource.
This recipe will discuss how to set the image displayed in an `ImageButton`, either declaratively in an Android layout file or programmatically in code.
@@ -6,7 +6,7 @@ recipe:
url: /Recipes/android/controls/listview/select-row/
api:
- title: "ListView"
url: /api/type/Android.Widget.ListView/
url: https://developer.xamarin.com/api/type/Android.Widget.ListView/
link:
- title: "Color State List Resource"
url: http://developer.android.com/guide/topics/resources/color-list-resource.html
@@ -54,7 +54,7 @@ class MyJSInterface : Java.Lang.Object
- Annotate each method that is to be exposed to JavaScript with
`[Export]` and `[JavascriptInterface]` (see
[IJavascriptInterface](/api/type/Android.Webkit.IJavascriptInterface/)
[IJavascriptInterface](https://developer.xamarin.com/api/type/Android.Webkit.IJavascriptInterface/)
for more information about the `JavascriptInterface` annotation).
In the following example, the `ShowToast` method is annotated so
that it can be called from JavaScript. Note that you must include the
@@ -97,7 +97,7 @@ interface class to the `WebView` that displays this HTML content.
1. Set the `WebView`'s `JavaScriptEnabled` flag to `true`.
2. Use [AddJavascriptInterface](/api/member/Android.Webkit.WebView.AddJavascriptInterface) to add an instance of `MyJSInterface` to the `WebView` as its JavaScript interface.
2. Use [AddJavascriptInterface](https://developer.xamarin.com/api/member/Android.Webkit.WebView.AddJavascriptInterface) to add an instance of `MyJSInterface` to the `WebView` as its JavaScript interface.
3. Load the HTML content into the `WebView`.
@@ -4,13 +4,13 @@ title: Detect Network Connection
brief: This recipe provides some quick snippets on how detect the type of network connection in use or how to query a specific type of network connection.
sdk:
- title: ConnectivityManager
url: /api/type/Android.Net.ConnectivityManager/
url: https://developer.xamarin.com/api/type/Android.Net.ConnectivityManager/
- title: NetworkInfo
url: /api/type/Android.Net.NetworkInfo/
url: https://developer.xamarin.com/api/type/Android.Net.NetworkInfo/
- title: ConnectivityType
url: /api/type/Android.Net.ConnectivityType/
url: https://developer.xamarin.com/api/type/Android.Net.ConnectivityType/
- title: NetworkInfo.State
url: /api/type/Android.Net.NetworkInfo+State/
url: https://developer.xamarin.com/api/type/Android.Net.NetworkInfo+State/
dateupdated: 2017-01-23
---
@@ -25,9 +25,9 @@ In this recipe we will cover how to load a scaled down version of an image so th
## Read Bitmap Dimensions and Type
The [BitmapFactory](/api/type/Android.Graphics.BitmapFactory/) class provides several methods (such as [DecodeResourceAsync](/api/type/Android.Graphics.BitmapFactory/)) for creating a [Bitmap](/api/type/Android.Graphics.Bitmap/) from various sources. These methods attempt to allocate memory for the constructed bitmap and therefore can easily result in an [OutOfMemoryException](/api/type/System.OutOfMemoryException/). Each type of decode method has additional signatures that let you specify decoding options, such as loading a smaller version of the bitmap, via the [BitmapFactory.Options](/api/type/Android.Graphics.BitmapFactory/%2bOptions) class.
The [BitmapFactory](https://developer.xamarin.com/api/type/Android.Graphics.BitmapFactory/) class provides several methods (such as [DecodeResourceAsync](https://developer.xamarin.com/api/type/Android.Graphics.BitmapFactory/)) for creating a [Bitmap](https://developer.xamarin.com/api/type/Android.Graphics.Bitmap/) from various sources. These methods attempt to allocate memory for the constructed bitmap and therefore can easily result in an [OutOfMemoryException](https://developer.xamarin.com/api/type/System.OutOfMemoryException/). Each type of decode method has additional signatures that let you specify decoding options, such as loading a smaller version of the bitmap, via the [BitmapFactory.Options](https://developer.xamarin.com/api/type/Android.Graphics.BitmapFactory/%2bOptions) class.
Setting the [InJustDecodeBounds](/api/property/Android.Graphics.BitmapFactory+Options.InJustDecodeBounds/) property to `true` while decoding avoids memory allocation, returning `null` for the bitmap object but setting [OutWidth](/api/property/Android.Graphics.BitmapFactory+Options.OutWidth/), [ OutHeight](/api/property/Android.Graphics.BitmapFactory+Options.OutHeight/) and [ OutMimeType](/api/property/Android.Graphics.BitmapFactory+Options.OutMimeType/) . This technique allows you to read the dimensions and type of the image data prior to construction (and memory allocation) of the bitmap.
Setting the [InJustDecodeBounds](https://developer.xamarin.com/api/property/Android.Graphics.BitmapFactory+Options.InJustDecodeBounds/) property to `true` while decoding avoids memory allocation, returning `null` for the bitmap object but setting [OutWidth](https://developer.xamarin.com/api/property/Android.Graphics.BitmapFactory+Options.OutWidth/), [ OutHeight](https://developer.xamarin.com/api/property/Android.Graphics.BitmapFactory+Options.OutHeight/) and [ OutMimeType](https://developer.xamarin.com/api/property/Android.Graphics.BitmapFactory+Options.OutMimeType/) . This technique allows you to read the dimensions and type of the image data prior to construction (and memory allocation) of the bitmap.
The following code snippet shows a function that will asynchronously retrieve the height and width of a drawable:
@@ -55,10 +55,10 @@ Now that the image dimensions are known, they can be used to decide if the full
* Estimated memory usage of loading the full image in memory.
* Amount of memory you are willing to commit to loading this image given any other memory requirements of your application.
* Dimensions of the target [ ImageView](/api/type/Android.Widget.ImageView/) or UI component that the image is to be loaded into.
* Dimensions of the target [ ImageView](https://developer.xamarin.com/api/type/Android.Widget.ImageView/) or UI component that the image is to be loaded into.
* Screen size and density of the current device.
For example, consider an image that is 4000x3000 pixels with a bitmap configuration of [Argb8888](/api/property/Android.Graphics.Bitmap+Config.Argb8888/). It would require approximately 46.8MB of RAM to load the full image into memory. It is better to load a smaller version of the image. To tell the decoder to subsample the image and load a smaller version into memory, set [InSampleSize](/api/property/Android.Graphics.BitmapFactory+Options.InSampleSize/) to a value that will be used to scale down the image. For example, setting `InSampleSize` to 2 will cause **BitmapFactory** to scale the image down by a factor of 2. Any value can be used, however `BitmapFactory` is optimized to use a value that is factor of 2.
For example, consider an image that is 4000x3000 pixels with a bitmap configuration of [Argb8888](https://developer.xamarin.com/api/property/Android.Graphics.Bitmap+Config.Argb8888/). It would require approximately 46.8MB of RAM to load the full image into memory. It is better to load a smaller version of the image. To tell the decoder to subsample the image and load a smaller version into memory, set [InSampleSize](https://developer.xamarin.com/api/property/Android.Graphics.BitmapFactory+Options.InSampleSize/) to a value that will be used to scale down the image. For example, setting `InSampleSize` to 2 will cause **BitmapFactory** to scale the image down by a factor of 2. Any value can be used, however `BitmapFactory` is optimized to use a value that is factor of 2.
Here’s a method to calculate the `InSampleSize` value as a power of 2 based on a target width and height:
@@ -117,5 +117,5 @@ The function `LoadScaledDownBitmapForDisplayAsync` is displayed in the following
}
You can follow a similar process to decode bitmaps from other sources, such as a file on the SD Card, by substituting the appropriate [BitmapFactory.DecodeXXX](/api/type/Android.Graphics.BitmapFactory/%2fM) method as needed.
You can follow a similar process to decode bitmaps from other sources, such as a file on the SD Card, by substituting the appropriate [BitmapFactory.DecodeXXX](https://developer.xamarin.com/api/type/Android.Graphics.BitmapFactory/%2fM) method as needed.
@@ -16,7 +16,7 @@ api:
- title: "Task<T>"
url: http://msdn.microsoft.com/en-us/library/dd321424(v=vs.110).aspx
- title: "UIProgressView"
url: /api/type/UIKit.UIProgressView/
url: https://developer.xamarin.com/api/type/UIKit.UIProgressView/
---
<a name="Overview" class="injected"></a>
@@ -4,7 +4,7 @@ title: "Create a Horizontal Scrolling Button List"
brief: "This recipe shows how to create a horizontal scrolling list of buttons."
article:
- title: "MonoTouch.UIKit.UIScrollView Class"
url: /api/type/UIKit.UIScrollView/
url: https://developer.xamarin.com/api/type/UIKit.UIScrollView/
sdk:
- title: "UIScrollView Class Reference"
url: https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html
@@ -12,7 +12,7 @@ to handle different runtime environments.
### Check Simulator vs. Device
You can detect whether you are running on the simulator or device by looking
up the value of the [ObjCRuntime.Runtime.Arch](/api/field/ObjCRuntime.Runtime.Arch/) field. If the value is [ARCH.Device](/api/type/ObjCRuntime.Arch/), you are running on the physical hardware,
up the value of the [ObjCRuntime.Runtime.Arch](https://developer.xamarin.com/api/field/ObjCRuntime.Runtime.Arch/) field. If the value is [ARCH.Device](https://developer.xamarin.com/api/type/ObjCRuntime.Arch/), you are running on the physical hardware,
otherwise you are running on the simulator.
<a name="Check_your_iOS_Version" class="injected"></a>
@@ -9,7 +9,7 @@ sdk:
- title: "CMMotionManager"
url: http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html
- title: "CMAccelerometerData"
url: /api/type/CoreMotion.CMAccelerometerData/
url: https://developer.xamarin.com/api/type/CoreMotion.CMAccelerometerData/
---
<a name="Recipe" class="injected"></a>
@@ -34,7 +34,7 @@ motionManager.StartAccelerometerUpdates (NSOperationQueue.CurrentQueue, (data, e
});
```
The first parameter, `data` is a [CMAccelerometerData](/api/type/CoreMotion.CMAccelerometerData/) instance holding the accelerometer data for the event.
The first parameter, `data` is a [CMAccelerometerData](https://developer.xamarin.com/api/type/CoreMotion.CMAccelerometerData/) instance holding the accelerometer data for the event.
# Additional Information
@@ -8,14 +8,14 @@ article:
url: https://developer.xamarin.com/guides/xamarin-forms/user-interface/webview/
api:
- title: "WebView"
url: /api/type/Xamarin.Forms.WebView/
url: https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/
- title: "HtmlWebViewSource"
url: /api/type/Xamarin.Forms.HtmlWebViewSource/
url: https://developer.xamarin.com/api/type/Xamarin.Forms.HtmlWebViewSource/
---
# Overview
The Xamarin.Forms [`WebView`](/api/type/Xamarin.Forms.WebView/) control displays HTML and other web content in an app. Unlike [`Device.OpenUri`](/api/member/Xamarin.Forms.Device.OpenUri/p/System.Uri/), which takes the user to the web browser on the device, the `WebView` control displays the web content inside the app. For more information about the `WebView` control, see [WebView](/api/type/Xamarin.Forms.WebView/).
The Xamarin.Forms [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control displays HTML and other web content in an app. Unlike [`Device.OpenUri`](https://developer.xamarin.com/api/member/Xamarin.Forms.Device.OpenUri/p/System.Uri/), which takes the user to the web browser on the device, the `WebView` control displays the web content inside the app. For more information about the `WebView` control, see [WebView](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/).
## Calling JavaScript
@@ -32,7 +32,7 @@ void OnCallJavaScriptButtonClicked (object sender, EventArgs e)
}
```
The [`WebView.Eval`](/api/member/Xamarin.Forms.WebView.Eval/p/System.String/) method evaluates the JavaScript that's specified as the method argument. In this example the `printMultiplicationTable` JavaScript function is invoked, which in turn displays a multiplication table for the passed parameters.
The [`WebView.Eval`](https://developer.xamarin.com/api/member/Xamarin.Forms.WebView.Eval/p/System.String/) method evaluates the JavaScript that's specified as the method argument. In this example the `printMultiplicationTable` JavaScript function is invoked, which in turn displays a multiplication table for the passed parameters.
The `printMultiplicationTable` JavaScript function is defined in the local HTML file that the `WebView` control loads, as shown in the following code example:
@@ -59,5 +59,5 @@ function printMultiplicationTable(num, stop)
# Summary
This recipe showed how to call a JavaScript function from C#, where the JavaScript function is defined in a web page hosted by the [`WebView`](/api/type/Xamarin.Forms.WebView/) control.
This recipe showed how to call a JavaScript function from C#, where the JavaScript function is defined in a web page hosted by the [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control.
@@ -5,7 +5,7 @@ subtitle: "How to display the correct virtual keyboard for an Entry"
brief: "This recipe shows how to display a virtual keyboard that is appropriate for the input text type, and how to specify additional keyboard options such as capitalization, spellcheck, and suggestions."
api:
- title: "Entry"
url: /api/type/Xamarin.Forms.Entry/
url: https://developer.xamarin.com/api/type/Xamarin.Forms.Entry/
---
# Overview
@@ -12,25 +12,25 @@ article:
url: https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/hybridwebview/
api:
- title: "WebView"
url: /api/type/Xamarin.Forms.WebView/
url: https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/
dateupdated: 2016-01-18
---
# Overview
The Xamarin.Forms [`WebView`](/api/type/Xamarin.Forms.WebView/) control displays HTML and other web content in an app. Unlike [`Device.OpenUri`](/api/member/Xamarin.Forms.Device.OpenUri/p/System.Uri/), which takes the user to the web browser on the device, the `WebView` control displays the web content inside the app. For more information about the `WebView` control, see [WebView](/api/type/Xamarin.Forms.WebView/).
The Xamarin.Forms [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control displays HTML and other web content in an app. Unlike [`Device.OpenUri`](https://developer.xamarin.com/api/member/Xamarin.Forms.Device.OpenUri/p/System.Uri/), which takes the user to the web browser on the device, the `WebView` control displays the web content inside the app. For more information about the `WebView` control, see [WebView](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/).
The [`WebView`](/api/type/Xamarin.Forms.WebView/) control can display PDF files on the iOS platform, but not on the Android and Windows Phone platforms due to lack of platform support. On the Android and Windows Phone platforms, Mozilla's [`pdf.js`](https://mozilla.github.io/pdf.js/) can be used to add this support. `pdf.js` is a JavaScript library for parsing and rendering PDFs using the HTML5 `canvas` element. The following screenshots show the result of displaying a PDF file in the `WebView` control on each platform:
The [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control can display PDF files on the iOS platform, but not on the Android and Windows Phone platforms due to lack of platform support. On the Android and Windows Phone platforms, Mozilla's [`pdf.js`](https://mozilla.github.io/pdf.js/) can be used to add this support. `pdf.js` is a JavaScript library for parsing and rendering PDFs using the HTML5 `canvas` element. The following screenshots show the result of displaying a PDF file in the `WebView` control on each platform:
![](Images/screenshots.png)
When a [`WebView`](/api/type/Xamarin.Forms.WebView/) control is rendered by a Xamarin.Forms application, in iOS the `WebViewRenderer` class is instantiated, which in turns instantiates a native `UIWebView` control. On the Android platform, the `WebViewRenderer` class instantiates a native `WebView` control. On the Windows Phone platform, the `WebViewRenderer` class instantiates a native `WebView` control. The rendering process can be taken advantage of to display a local PDF file in a `WebView`, by creating a custom renderer for the `WebView` on each platform. The process for doing this is as follows:
When a [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control is rendered by a Xamarin.Forms application, in iOS the `WebViewRenderer` class is instantiated, which in turns instantiates a native `UIWebView` control. On the Android platform, the `WebViewRenderer` class instantiates a native `WebView` control. On the Windows Phone platform, the `WebViewRenderer` class instantiates a native `WebView` control. The rendering process can be taken advantage of to display a local PDF file in a `WebView`, by creating a custom renderer for the `WebView` on each platform. The process for doing this is as follows:
1. [Create](#Creating_the_Custom_WebView_Control) a Xamarin.Forms custom control.
1. [Consume](#Consuming_the_Custom_Control) the custom control from Xamarin.Forms.
1. [Create](#Creating_the_Custom_Renderer_on_Each_Platform) the custom renderer for the control on each platform.
For information about customizing a [`WebView`](/api/type/Xamarin.Forms.WebView/) control using a custom renderer, see [Implementing a HybridWebView](https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/hybridwebview/).
For information about customizing a [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control using a custom renderer, see [Implementing a HybridWebView](https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/hybridwebview/).
## Creating the Custom WebView Control
@@ -193,5 +193,5 @@ Provided that the custom renderer is attached to a new Xamarin.Forms element, th
# Summary
This recipe showed how to display a local PDF file in a [`WebView`](/api/type/Xamarin.Forms.WebView/) control on each platform.
This recipe showed how to display a local PDF file in a [`WebView`](https://developer.xamarin.com/api/type/Xamarin.Forms.WebView/) control on each platform.
@@ -7,7 +7,7 @@ samplecode:
url: https://github.com/xamarin/recipes/tree/master/cross-platform/xamarin-forms/Controls/multiselect
---
The Xamarin.Forms [`ListView`](/api/type/Xamarin.Forms.ListView/)
The Xamarin.Forms [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/)
control only has a single `SelectedItem`, and cannot represent selection of
mulitple rows.
Oops, something went wrong.

0 comments on commit cc6defb

Please sign in to comment.