< 98% Android- iOS->
Nikolai Sander, EODSof.
< .NET-, MonoTouch. .>
Robert Kozak, Nowcom Corporation.
Xamarin , C# iOS Android - MonoTouch MonoDroid. :
Android:
01.
using
System;
02.
using
System.Collections.Generic;
03.
04.
using
Android.App;
05.
using
Android.OS;
06.
using
Java.Lang;
07.
using
Android.Widget;
08.
using
Android.Content;
09.
10.
namespace
MonoDroid.ApiDemo
11.
{
12.
[Activity (Label =
"Content/Resources Sample"
)]
13.
[IntentFilter (
new
[] { Intent.ActionMain }, Categories =
new
string
[] { ApiDemo.SAMPLE_CATEGORY })]
14.
public
class
ResourcesSample : Activity
15.
{
16.
protected
override
void
OnCreate (Bundle savedInstanceState)
17.
{
18.
base
.OnCreate (savedInstanceState);
19.
SetContentView (Resource.Layout.resources);
20.
TextView tv;
21.
ICharSequence cs;
22.
string
str;
23.
24.
//
25.
cs = GetTextFormatted (Resource.String.styled_text);
26.
tv = (TextView)FindViewById (Resource.Id.styled_text);
27.
tv.TextFormatted = cs;
28.
29.
//
30.
str = GetString (Resource.String.styled_text);
31.
tv = (TextView)FindViewById (Resource.Id.plain_text);
32.
tv.Text = str;
33.
34.
Context context =
this
;
35.
36.
//
37.
Android.Content.Res.Resources res = context.Resources;
38.
//
39.
cs = res.GetTextFormatted (Resource.String.styled_text);
40.
tv = (TextView)FindViewById (Resource.Id.res1);
41.
tv.TextFormatted = cs;
42.
}
43.
}
44.
}
iOS:
01.
using
System;
02.
using
System.Collections.Generic;
03.
using
System.Linq;
04.
using
MonoTouch.UIKit;
05.
using
MonoTouch.Foundation;
06.
using
SysSound.Extensions;
07.
using
MonoTouch.AudioToolbox;
08.
09.
namespace
SysSound {
10.
public
partial
class
SysSoundViewController : UIViewController {
11.
12.
// SysSoundViewController.xib
13.
public
SysSoundViewController ()
14.
:
base
(
"SysSoundViewController"
,
null
) {
15.
}
16.
17.
//,
18.
private
SystemSound Sound;
19.
20.
//
21.
public
override
void
ViewDidLoad () {
22.
base
.ViewDidLoad ();
23.
//
24.
AudioSession.Initialize();
25.
//
26.
Sound = SystemSound.FromFile(
"Sounds/tap.aif"
);
27.
}
28.
29.
partial
void
playSystemSound(NSObject sender) {
30.
Sound.PlaySystemSound();
31.
}
32.
33.
partial
void
playAlertSound (NSObject sender) {
34.
Sound.PlayAlertSound();
35.
}
36.
partial
void
vibrate (NSObject sender) {
37.
SystemSound.Vibrate.PlaySystemSound();
38.
}
39.
}
40.
}
Mono android, My Football Pro HD ( , 800 ) CoinKeeper ( ).
.
$399 1 . , store.xamarin.com
10.11.2021 - 12:37: - Personalias -> WHO IS WHO - - _. 10.11.2021 - 12:36: - Conscience -> . ? - _. 10.11.2021 - 12:36: , , - Upbringing, Inlightening, Education -> ... - _. 10.11.2021 - 12:35: - Ecology -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> - _. 10.11.2021 - 12:34: , - War, Politics and Science -> . - _. 10.11.2021 - 12:34: , , - Upbringing, Inlightening, Education -> , - _. 10.11.2021 - 09:18: - New Technologies -> , 5G- - _. 10.11.2021 - 09:18: - Ecology -> - _. 10.11.2021 - 09:16: - Ecology -> - _. 10.11.2021 - 09:15: , , - Upbringing, Inlightening, Education -> - _. 10.11.2021 - 09:13: , , - Upbringing, Inlightening, Education -> - _. |