android - adjusting touchable grid to fit screen -


what trying achieve create grid user can tap on of squares, there background image of car , idea choose area of car. having problems @ fitting image match squares, how can achieve in better way?

this doing @ moment:

<relativelayout              android:layout_width="match_parent"             android:layout_height="wrap_content"             android:paddingtop="30dp"             android:layout_marginleft="17dp"             android:layout_marginright="17dp"             android:layout_below="@+id/texttitulo"             android:id="@+id/contenedorvehiculo">              <imageview                 android:layout_width="match_parent"                 android:layout_height="600dp"                 android:paddingtop="10dp"                 android:id="@+id/imgveh"                 android:background="@drawable/auto"/>              <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque1"                 android:clickable="true"                 android:background="@drawable/button_choque"                 android:layout_aligntop="@+id/imgveh">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque2"                 android:clickable="true"                 android:layout_torightof="@+id/choque1"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque3"                 android:clickable="true"                 android:layout_torightof="@+id/choque2"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque4"                 android:clickable="true"                 android:layout_below="@+id/choque1"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque5"                 android:clickable="true"                 android:layout_torightof="@+id/choque4"                 android:layout_below="@+id/choque2"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque6"                 android:clickable="true"                 android:layout_torightof="@+id/choque5"                 android:layout_below="@+id/choque3"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque7"                 android:clickable="true"                 android:layout_below="@+id/choque4"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque8"                 android:clickable="true"                 android:layout_torightof="@+id/choque7"                 android:layout_below="@+id/choque5"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque9"                 android:clickable="true"                 android:layout_torightof="@+id/choque8"                 android:layout_below="@+id/choque6"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque10"                 android:clickable="true"                 android:layout_below="@+id/choque7"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque11"                 android:clickable="true"                 android:layout_torightof="@+id/choque7"                 android:layout_below="@+id/choque8"                 android:background="@drawable/button_choque">             </view>             <view                 android:layout_width="138dp"                 android:layout_height="152dp"                 android:id="@+id/choque12"                 android:clickable="true"                 android:layout_torightof="@+id/choque8"                 android:layout_below="@+id/choque9"                 android:background="@drawable/button_choque">             </view>          </relativelayout> 

and result, idea of view modify alpha indicate has been clicked:

result

the idea make of 3 3 grid, means grid won't square


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -