나는이 퀴즈를 개발하고 있지만이 문제는이 디자인 ...안드로이드 이클립스는 XML
GuessButton.xml
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/newGuessButton"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/buttonshape"
android:layout_weight="1"
android:shadowColor="#000000"
android:shadowDx="5"
android:shadowDy="2"
android:shadowRadius="5" >
</Button>
buttonshape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="50dp"
/>
<gradient
android:gradientRadius="200"
android:centerX="35%"
android:centerY="50%"
android:centerColor="#5E0707"
android:startColor="#E80909"
android:endColor="#000000"
android:type="radial"
/>
<size
android:height="50dp"
/>
<stroke
android:width="2dp"
android:color="#878787"
/>
</shape>
버튼이 표시
홈페이지 XML :
<TableLayout
android:id="@+id/buttonTableLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:stretchColumns="*" >
<TableRow
android:id="@+id/tableRow0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</TableRow>
</TableLayout>
xm L 코드 이미지가 표시되는 위치 : 그들은 자산 폴더에있는 사촌 모든 장치에 맞게 이미지의 경우
<ImageView
android:id="@+id/faceImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="false"
android:scaleType="centerInside" />
.. 나는이 만든 코드 : 제가 테스트 한 모든 장치에 따라서
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.kuizi);
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int width = displaymetrics.widthPixels;
int h = faceImageView.getLayoutParams().height;
h = width/2;
faceImageView.getLayoutParams().height = h;
을 그것은 잘 작동
:하지만 내 친구에
전화는 다음과 같이이다 : ... 여기 screenshoot입니다 그 ... 내가 찾은 일주일에 아무것도 인터넷에서 찾고 있어요 왜
그래서 작은 이미지와 나쁜 버튼 ... 나는 알아낼 수 없습니다 ... 누군가 pls는 저를 도울 수 ... 미리 감사드립니다 ... 정말 도움을 주시면 고맙겠습니다 ...
기기 정보를 추가해주세요. 각 기기에서 실행중인 Android의 버전은 무엇입니까? –
안드로이드 4.4.2는 안드로이드 4.2.2 및 일부 다른 안드로이드에서 작동하지 않습니다 ... –