Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README.md - added some faq s. #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ To our knowledge (try: `grep -r -e "void set[^(]*(Typeface " <android source dir

Both have a method called `setSwitchTypeface` that sets the typeface within the switch (e.g. on/off, yes/no). `SetTypeface` sets the typeface of the label. You will need to create your own subclass that overrides `setTypeface` and calls both `super.setTypeface` and `super.setSwitchTypeface`.

### I'm getting java.lang.ClassCastException

If you're getting exceptions like in [this](https://github.com/chrisjenx/Calligraphy/issues/211) issue. Please check that you're overriding your activities's `attachBaseContext` method but not your application's `attachBaseContext` method.

### Custom fonts work on some View's but doesn't work on some others.

Check that you're getting your `LayoutInflater` s from right context. Meaning get `LayoutInflater`s from activities's base context, not from appliation's context or activities's application context.

```java
LayoutInflater trueLayoutInflater = (LayoutInflater)myActivity.getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LayoutInflater falseLayoutInflater = (LayoutInflater)myActivity.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
```



Expand Down