我使用了查看日历西班牙语,但我不确定如何更改语言,有些属性在任何地方都不可用。
现在我有这个:
<CalendarView
android:id="@+id/calendari"
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weekNumberColor="@color/botoCalendari"
android:focusedMonthDateColor="#d91f1f"
android:weekSeparatorLineColor="#1fd928"
android:selectedWeekBackgroundColor="#1fd9d6"
android:unfocusedMonthDateColor="#d91fd9"
/>
Run Code Online (Sandbox Code Playgroud)
是否有任何财产或代码?
非常感谢。
这可能对你有帮助。
import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String languageToLoad = "fa"; // your language
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
this.setContentView(R.layout.main);
}
}
Run Code Online (Sandbox Code Playgroud)
你在这里找到例子
| 归档时间: |
|
| 查看次数: |
6491 次 |
| 最近记录: |