我一直在努力为Android应用创建一个启动画面,如 Splash Screens the Right Way |中所述 大书呆子牧场的风格
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
Run Code Online (Sandbox Code Playgroud)
background_splash看起来像
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/background"/>
<item android:drawable="@drawable/sparrow"/>
</layer-list>
Run Code Online (Sandbox Code Playgroud)
和sparrow.xml看起来像
<vector android:height="240dp"
android:width="240dp"
android:viewportHeight="512.0"
android:viewportWidth="512.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#e000"
android:pathData="M407.2,55.2c-20.8,2.4 -42.9,16.8 -65.6,42.7 -4.5,5.1, lot of data here ,-8.2z" android:strokeColor="#00000000"/>
<path android:fillColor="#cc0000"
android:pathData="M474,98.9c-12.6,3.9 -17.8,15.3 -12.4,26.8 1.4,2.8 3.1,5.4 3.9,5.7 1.3,0.5 11.4,-0.5 20.5,-1.9 1.4,-0.2 5,-0.6 8,-1 8,-0.8 11.1,-1.6 10.8,-2.5 -0.3,-0.7 -5.1,-6.4 -21.4,-25.3 -2.4,-2.7 -4.7,-3.2 -9.4,-1.8z" android:strokeColor="#00000000"/>
</vector>
Run Code Online (Sandbox Code Playgroud)
但是,我看到的问题是,vector当在设备屏幕上显示时,宽高和高度属性定义的宽高比为1:1 不会保持不变.例如,在android studio中如下显示圆圈
但是,上面的图像在设备上显示如下,因为它接管了可用的所有可用高度.
我是pandoc的新手,并使用它将一组markdown文件转换为pdf.我想更改pdf的默认字体.
文档提供了设置字体的示例
pandoc -N --template=mytemplate.tex --variable mainfont=Georgia --variable
sansfont=Arial --variable monofont="Bitstream Vera Sans Mono" --variable
fontsize=12pt --variable version=1.10 README --latex-engine=xelatex --toc
-o example14.pdf
Run Code Online (Sandbox Code Playgroud)
但是这使用了xelatex,建议使用MiKTeX.
我已尝试过上述内容MiKTeX,但没有任何成功.
有没有办法设置字体,我使用的是Windows 8 MiKTeX
我已经使用http://developer.android.com/tools/data-binding/guide.html中描述的数据绑定创建了一个简单的登录屏幕,但是我无法获得更改的文本通知
任何帮助表示赞赏
我认为对于文本框通知,android团队可能没有完全实现它.但是,我无法理解按钮单击处理程序的错误.
片段代码看起来像
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
FragmentAccountSetupInitialBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_account_setup_initial, container, false);
View view = binding.getRoot();
binding.setAccount(new UserAccount());
return view;
}
Run Code Online (Sandbox Code Playgroud)
用户帐户的ViewModel定义如下
public class UserAccount extends BaseObservable {
private String _email;
private String _password;
@Bindable
public String getEmail() {
return _email;
}
public void setEmail(String email) {
if(!TextUtils.equals(_email, email)) {
_email= email;
notifyPropertyChanged(BR.email);
}
}
@Bindable
public String getPassword() { …Run Code Online (Sandbox Code Playgroud) 我认为HttpClient应该能够处理301错误代码,并重定向到正确的地址。但是,使用以下地址(https://www.npr.org/templates/rss/podcast.php?id=510298),它会抛出异常。不过浏览器能够正确处理它。只是想了解是否有出路或者我错过了什么。
HttpClient client = new HttpClient();
var s = await client
.GetStringAsync("https://www.npr.org/templates/rss/podcast.php?id=510298");
Run Code Online (Sandbox Code Playgroud)
投掷
Test1 [0:00.779] Failed: System.Net.Http.HttpRequestException : Response
status code does not indicate success: 301 (Moved Permanently).
System.Net.Http.HttpRequestException : Response status code does not
indicate success: 301 (Moved Permanently).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at System.Net.Http.HttpClient.GetStringAsyncCore(Task`1 getTask)
at XUnitTestProject1.UnitTest1.Test1() in
C:\Users\res\source\repos\test\XUnitTestProject1\UnitTest1.cs:line 13
Run Code Online (Sandbox Code Playgroud) 我想AutoSuggestBox在CommandBar. 但是,以下代码不会进行AutoSuggestBox拉伸。我尝试设置HorizontalContentAlignment="Stretch"and HorizontalAlignment="Stretch",但没有影响。我错过了什么?
<CommandBar Grid.Row="0" HorizontalContentAlignment="Stretch">
<CommandBar.Content>
<AutoSuggestBox HorizontalAlignment="Stretch" Margin="8 8 8 4" PlaceholderText="Search podcasts" QueryIcon="Find">
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="QuerySubmitted">
<Core:InvokeCommandAction
Command="{Binding SearchCommand}"
InputConverter="{StaticResource QueryArgsConverter}" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</AutoSuggestBox>
</CommandBar.Content>
</CommandBar>
Run Code Online (Sandbox Code Playgroud)
鉴于 的实现.net standard library是由带下划线的实现提供的(.Net framework, .Net Core(windows/Linux etc) )。这些 API 的行为可能几乎没有什么不同。TimeZoneInfo.Id根据操作系统提供不同的结果(上次我检查过)。
那么,如何进行单元测试?在visual studio中,我们可以创建一个.Net Core xUnit项目或.Net Framework xUnit项目。如何xUnit在两个不同的环境中运行相同的测试?
我正在尝试更改的颜色NavigationView。该文档提供了一个很好的示例,说明如何更改背景,但是我找不到如何更改菜单项的字体颜色。我还能够使用以下命令更改选择指示器的颜色<SolidColorBrush x:Key="SystemControlForegroundAccentBrush" Color="#FFFFFFFF" />
c# ×3
android ×2
.net ×1
.net-core ×1
autosuggest ×1
commandbar ×1
fonts ×1
markdown ×1
miktex ×1
pandoc ×1
search-box ×1
unit-testing ×1
uwp ×1
uwp-xaml ×1
xaml ×1